Problems
Solutions
With seam
h:commandButton also follows this pattern. When user clicks on h:commandButton, it will automatically send http post request to server. At the phase render response in JSF life cycle, it will send http get to browser to render page. Hence, to pass a parameter to next page after user clicks on h:commandButton, seam can help us to do this task very easily
Page1: which has the command button
<h:commandButton action="execute">
</h:commandButton>
Page1.page.xml
cThe navigation rule will tell seam that whenever render response (page 2), it will pass param1 to page2. When render response, seam follow Post/Redirect/Get, it means that seam send get request to server to render page 2
For page 2, to receive the param which passed from page 1, we just need to declare all params needed in page2.page.xml
page2.page.xml
<param name="param1" value=#{bean2.param1} />
<navigation>
</navigation>