Win a copy of Python Continuous Integration and Delivery this week in the Python forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

glassfish auto-generates unwanted session  RSS feed

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Somehow glassfish seems to be generating a session for me, even without my explicit request.

I set up a small "dynamic web project" with eclipse, with a single jsp to show the problem, which consists in the http response containing a set-cookie for the jsessionid. I have no request.getSession() call or equivalent in my code. Can someone explain what is going on here and tell me how to disable it ?

jsp (disregard the fact that it uses scripplets and not EL/JSTL...)



web.xml


sun-web.xml (generated by eclipse)


result:




Thank you in advance.
 
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the default behavior for JSPs.
It's part of the JSP spec, not something specific to Glassfish.

Look at the <%@ page ...> directive documentation to see how to disable this.


See:
http://java.sun.com/products/jsp/tags/11/syntaxref11.fm7.html
 
Jonh Smith
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much for your help Ben!
 
He's dead Jim. Grab his tricorder. I'll get his wallet and this tiny ad:
Become a Java guru with IntelliJ IDEA
https://www.jetbrains.com/idea/
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!