Get your CodeRanch badge!*
The moose likes Servlets and the fly likes HttpSession vs PageContext Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "HttpSession vs PageContext " Watch "HttpSession vs PageContext " New topic
Author

HttpSession vs PageContext

Brian Nice
Ranch Hand

Joined: Nov 02, 2000
Posts: 195
If I am in a servlet and have an instance of PageContext, say pageContext, and I do:
pageContext.setAttribute(SESSION_BEAN_NAME, bean, PageContext.SESSION_SCOPE);
or I have an instance of HttpSession, say session, and store the bean in there:
session.setAttribute(SESSION_BEAN_NAME, bean);
What is the difference for this? Both ways I can still use in my JSP page <jsp:useBean id="whatever" scope="session" ... /> and have access to my bean. Or is there a difference?
Thanks!
Brian
bcnice@mindspring.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HttpSession vs PageContext
 
Similar Threads
explanation in Jwebplus
Diff between HttpSession and Stateful Session bean
distinctions between Stateless and Stateful bean
Passing a bean property to a custom tag using JSTL
How to display byte[]