This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I'm developing a web-based app using Struts. My first page is a Category selection screen. I have created Action and ActionForm classes for this page and added entries in struts-config.xml. This part is working fine. The next page will be Parameters selection screen. I still need to create Action and ActionForm classes for this page. One thing I'm not able to find out is how do I pass the values from one page to another ? For instance how does Parameters selection screen will get the value selected in Category selection screen ? I'm thinking of using
* another bean class to store all variables * using session varibale
But not sure what's the best option. Really appreciate any suggestions.
You do not have to use session scoped forms to solve this issue if you do not want to. I would probably code this up to use a single form bean that both pages would use. When you submit the first page, the submitted category selected value will be populated on the form and available to the second page. If you need to maintain this value, then store it as a hidden field on the second jsp. Then when the second page is submitted, you will have both the selected category and parameter.