• 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

Session Tracking

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to use the session object and I'm unable to pass a value from one page to another. I'm using the setAttribute and getAttribute methods. I've tried using both the include directive and action.
When I looked at the examples that came with TOMCAT, I noticed that they didn't work either (they did in the past). Is it possible that I've somehow disabled session tracking?
Thanks,
Steve
 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Steven,
Is your browser supporting cookies? And if it doesn't, does your web containter use URL rewriting? It needes at least one of these methods to support session on HTTP.
 
Steven Lyner
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kees,
I'm relatively inexperienced in JSP development. How do I check these things? I'm using Internet Explorer as my browser. I do have the following in my SERVER.XML File:
<RequestInterceptor
className="org.apache.tomcat.request.SessionInterceptor"
noCookies="true" />

I have tried it with "false".
Thanks,
Steve
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Steven,

It might be entirely unrelated, but something in your original post makes me curious.

you said: I've tried using both the include directive and action.

This has nothing to do with session objects. includes are for including resources like other jsps, plain HTML files, etc.

What is the code you are using?


As for cookies and Tomcat, here is their pagewhere they mention configuration of session tracking. This page is for the Default Context, which is used if you haven't provided your own Context for the web application in question. If you have, you should check that Context for the appropriate attribute.

A word on URL-rewriting: If your client doesn't support or won't accept cookies, then the container will 'switch' to URL rewriting, but you must help it out a bit. Check out the API for the HttpServletResponse.encodeURL() method. It says 'servlets' but JSP pages count too.
 
Steven Lyner
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kees and Mike,
I looked at the SERVER.XML file and I found that the nocookies attribute was set to "true". I changed it to "false". I honestly thought that I had changed this before and tested it. Its possible that I did but I tested it incorrectly (I went through many gyrations).
Thanks a lot.
Steve
 
reply
    Bookmark Topic Watch Topic
  • New Topic