permaculture playing cards*
The moose likes Struts and the fly likes Collection in request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Collection in request" Watch "Collection in request" New topic
Author

Collection in request

Albert Gorski
Greenhorn

Joined: Sep 17, 2003
Posts: 2
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.
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4462
    
    6

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).


Junilu - [How to Ask Questions] [How to Answer Questions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Collection in request