• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Collection in request

 
Albert Gorski
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7486
50
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic