File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Best method" Watch "Best method" New topic

Best method

Sathyanarayana Katakam

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?
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

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.
I agree. Here's the link:
subject: Best method
Similar Threads
HFSJ - errata
How to identify client calls from server side
finding the jsp
How to access JSP variable in java class
how can I send the output of a servlet to a jsp page?