• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Sessions

 
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic