This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Servlets and the fly likes Best method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Best method" Watch "Best method" New topic
Author

Best method

Sathyanarayana Katakam
Greenhorn

Joined: Oct 12, 2000
Posts: 2
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

Joined: Mar 06, 2001
Posts: 13459

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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Best method