This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes JSP and the fly likes jsp session scope List values Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JSP
Reply Bookmark "jsp session scope List values" Watch "jsp session scope List values" New topic
Author

jsp session scope List values

Mujahed Syed
Greenhorn

Joined: May 18, 2010
Posts: 20

Hello,

I am trying to save a ArrayList of values in sesssion scope. This is basically a Shopping cart which is storing all the items in basket. If I use the method request.setAttribute(String, Object) it will store my values in request scope. If I use session.setAttribute(String, Object) will my method have a global scope in the application? And will I be able to access this from any jsp/servlet pages?

Thanks


SCJP, OCWCD
Shankar Tanikella
Ranch Hand

Joined: Jan 30, 2011
Posts: 329

Session is not global scope

Request, application or sessions are completely different types of scopes available in a web application.

When you ask for global, session is not global scope, it is per user (to be more specific, for one browser).

Yes, values in the session would be available in JSPs and access the same, but only for that user


Have Fun with Java
little,little.. little by little makes a lot..
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: jsp session scope List values
 
Similar Threads
how to get access request objects through struts tags
html:select vanishing values
How to add values in arraylist using JSTL
JSP & useBean
Session variables are getting hosed!