Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!