Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Best method

 
Sathyanarayana Katakam
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When processing a request what is BEST suited method for sharing data between Servlets and JSPs? I mean using a 'Request Object', Session or SessionContext?
Thanks.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Personally:
Always the Request Object.
Putting transient data on the session wastes resources and can cause problems if the data isn't handled properly.
The Servlet context is shared across all servlets and is therefore not thread-safe.
Dave.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic