This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
That will get the current HTTPSession for the client, or create one if it doesn't already exist. If the argument value to getSession() was false, no session will be created if one doesn't already exist. The following CreateSession servlet illustrates how to create a session and glean some important session statistics such as creation time, last access time, the maximum lifetime of a session in seconds and most importantly, the session id that is used to uniquely identify a client's session.
Sureshvasan Paramasamy
Greenhorn
Joined: May 25, 2004
Posts: 24
posted
0
Thanks
This is what i want if in the login servlet i created a session session=req.getSession(true); and set a value like session.setAttribute("WAS",strWAS)
if i want to get value in the next servlet ,then again i want to create a session or just i can use String strWAS2=session.getAttribute("WAS");
pls explain it
Siyaa Hoffman
Greenhorn
Joined: Jan 15, 2004
Posts: 23
posted
0
Hi Sureshvasan,
In the next servlet, if the next servlet is invoked in the same session, you would be able to just do session.getAttribute(attributeName) to get the value. You do not need to create any new session in that servlet.
But if the next servlet is not invoked in the same session, you cannot access the attribute defined in the session scope. If that is a possibility, you need to see which scope would suit you. The available scopes are -
request session application
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.