• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Making data accessible to JSP from an Action

 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just started to look at Struts.

What is the preferable way of making data accessible for a JSP from a Struts action?

I currently store it in the session object. But this seems unnecessary since the only jsp that has to have access to the data is the one defined by Struts' forward mapping for the action (whereas the session stored object scopes over all jsp's).

Thanks,

Seb
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The preferable way to make data available to a JSP from a struts action is to place it in a JavaBean that extends ActionForm, and to place a reference to that object in the HttpServletRequest object. In cases of multiple page forms, you may need to store the data in the session object, but the request is preferred if you can make it work.
reply
    Bookmark Topic Watch Topic
  • New Topic