This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Servlets and the fly likes Sessions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Sessions" Watch "Sessions" New topic
Author

Sessions

Matthew X. Brown
Ranch Hand

Joined: Nov 08, 2000
Posts: 165
I'm using HttpSession objects for an on-line form
HttpSession session = request.getSession(true);
session.setAttribute("test", test);
Where the attribute "test" is a javabean that stores all of the data associated with the session. During each subsequent request(or step), I do the getSession method-if its new-I invalidate the session. And I also use the following method to get the bean:
TestSql test = (TestSql)session.getAttribute("test");
I use a request dispatcher to forward to a jsp page. The jsp page uses
<jsp:useBean id="test" class="TestSql" scope="session"/>
and uses data from the bean. My question is ---- am I tracking sessions properly- I mean- should I use URL-rewriting or hidden fields to generate and store session id's to identify them to the server. I've had no problems so far(all of the data has been correct), but I'm wondering if I still need to implement a session tracking mechanism in addition to the java bean attributes.Thanks in advance.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sessions
 
jQuery in Action, 3rd edition