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.
Hi, I have follwoing problem: - in Action I add new attribute to REQUEST of Collection type - in jsp page I can obtain the data (to fill Selection) - !!! in Action, after submit, Collection attribute does not exist anymore. Any hints how to pass Collection from JSP to Action class in request?
I do not want to use session as a cache because it is memory expensive. Thanks for any help.
Request-scoped attributes exist only during the lifetime of the request (go figure). Once the request has been processed and the response sent back, the request and all attributes tied to it go away. You need to add a field to your ActionForm that is of type Collection and the corresponding getters and setters. You can find more info on this on the web by searching for "struts indexed properties" (seems to be a hot topic these days).