If I have a request scope bean on a page in JSF2….how do I pass it to another page (I’m using JSF2 with Spring)?
I’ve tried the following but it doesnt work:
<h:commandButton action="complete.xhtml?faces-redirect=true" value="Confirm Booking">
<f:setPropertyActionListener target="#{quoteHolder.item}" value="#{quoteHolder.item}"/>
</h:commandButton>
You’re sending a redirect. The
<f:setPropertyActionListener>won’t help much here as the request scoped bean will be garbaged after the invoke action phase anyway.You have basically the following options:
Send all the data as request parameter(s) instead (conversion to/from
Stringnecessary!)Don’t send a redirect (the
<f:setPropertyActionListener>becomes superfluous then)Store it in a session scoped bean (not recommended! may be bad for user experience).