webtier@glassfish.java.net

Flash scope issue

From: <webtier_at_javadesktop.org>
Date: Fri, 23 Oct 2009 06:54:04 PDT

Hello,
I used the flash scope the following way:
the page
<ui:define name="body">
                #{flash['wizardId']}
                <h:form>
                        <h:commandButton action="#{wizardBean.start}" value="Start"/>
                </h:form>
        </ui:define>
the bean sending the user to the same page using a redirect
@ManagedBean
public class WizardBean {
        public String start(){
                FacesContext.getCurrentInstance().getExternalContext().getFlash().put("wizardId", 4711);
                return "wizardstart?faces-redirect=true";
        }

}


My expected behaviour is:
Flash value is printed on the next page. A reload of the page let it disappear.
This happens as expected but the next reload shows the value again and then the flash value finally disappears with the next reload.

I have 3 questions:
Is the flash scope a mummy flash scope which comes to live again?
Did I misunderstood how to use it?
Why is the flash scope not saved in the session instead of creating another cookie?

Best Regards
Sebastian Hennebrueder
http://www.laliluna.de
[Message sent by forum member 'laliluna' (i_at_laliluna.de)]

http://forums.java.net/jive/thread.jspa?messageID=369117