Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Design issue; request/session-objects

 
Nems Vedek
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have a .jsp-form that is populated by the actionform. I also have all kind of other information in this page populated by resultbean (content etc).

Resultbean is saved in the action with request.setAttribute("")

If the validation fails, all the stuff in the resultben naturally disappears because they were saved is request-scope.

The question is, what is the right approach to avoid this ? I know that I can go around this problem by saving the resultbeans to session-scope, but is this really the only way ? It just feels rarther stupid to always put everything to the session.

Does the session-objects take away much memory or strain the server badly ?
How about deleting the stuff from session when the forms action has been called (i.e: validation was successful)

Hmm, have been doing web-stuff with plain .jsp / beans before and it just feels that everything is n+1 times complicated with the struts ...

Anyway thanks if someone bothers to answer ...
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34178
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nems,
Welcome to JavaRanch!

The request remains available until you repaint the JSP page and presumably fill in the form data again. After that, you don't need it anymore, right?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic