• 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 ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

HTTPSession, Struts 2 and Scalability

Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a struts 2 application which has many JSPs that display a list of results on the screen.
The process is as follows:

DisplayCriteriaForm: - This action class simply goes to a JSP that displays some fields on the screen for the user to enter
DisplayResultsAction - This action takes the request parameters from the JSP mentioned above and displays the results by querying the database and returning a collection
ValidationSelectionAction - The idea is the user can select one of the results returned and this action simply validates if one of the checkboxes was selected. If nothing was selected I want to remain on the same page (i.e. the results jsp) with a actionError at the bottom saying "please select a item".

The problem I have is that ValidationSelectionAction needs to have access to the list of results the DisplayResultsAction had retrieved from the Database so it can redisplay the same page upon encountering an actionError. The only way I can do it at the moment is to store the results in the HTTPSession object so that ValidationSelectionAction can retrieve them and return them in a getter method.

While this solution does work, it is not scalable due to the heap being utilized with HTTPSession. In a multi-user environment it is known to crash the system when the sessions gets too full. There are many J2EE best practices that I have seen that also say not to overuse the session. But no-one has mentioned alternatives.
Is there anyway to pass complex data between actions without using the session? Are there any other frameworks that handle this responsibiity for you out there?
Posts: 9708
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Checkout this FAQ...
I hired a bunch of ninjas. The fridge is empty, but I can't find them to tell them the mission.
a bit of art, as a gift, the permaculture playing cards
    Bookmark Topic Watch Topic
  • New Topic