Skip to main content

Flash scope data is missing after redirect to other directory

3 replies [Last post]
mafas
Offline
Joined: 2011-02-04
Points: 0

Then I am sending post request from page situated in one directory, storing some data in flash scope and redirecting by outcome to page in other directory, data in flash scope is missing and I can't reference it on target site. However then I am doing the same request from page in the same directory as target, data in flash scope is present. Is it an issue or some intended behaviour? I am using the latest JSF release.
Here are some snippets to reproduce:
Page /index.xhtml
...
<h:commandButton action="#{flashMBean.test}" value="Flash test" />
...
Page /flash/test.xhtml
...
<h:outputText value="#{flash['SampleData']}"/>
...
FlashMBean
public void test(){
FacesContext.getCurrentInstance().getExternalContext().getFlash().put("SampleData", "abc123");
return "test"
}

Navigation case:
<navigation-case>
<from-outcome>test</from-outcome>
<to-view-id>/flash/test.xhtml</to-view-id>
<redirect />
</navigation-case>
Thanks,
Maciek

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mafas
Offline
Joined: 2011-02-04
Points: 0

Here is some better explanation for the problem source: http://www.coderanch.com/t/518729/JSF/java/JSF-Flash-scope-cookie-not

tiefflieger
Offline
Joined: 2009-01-29
Points: 0

Hi,
I'm facing exactly the same problem. Would please anyone take a look at this? I really wonder why this hasn't got more attention, as this renders flash unusable in most cases.
Maybe related to this, I have a similar Problem using FacesMessages and flash.setKeepMessages(true), I reported a bug a while ago: http://java.net/jira/browse/JAVASERVERFACES-1877
Tried with GlassFish 3.01 and 3.1 b40, no difference

tiefflieger
Offline
Joined: 2009-01-29
Points: 0

sorry for the quadro-posts, I kept on getting an "internal server error", so I tried again three times :-/