File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes glassfish auto-generates unwanted session Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "glassfish auto-generates unwanted session" Watch "glassfish auto-generates unwanted session" New topic
Author

glassfish auto-generates unwanted session

Jonh Smith
Ranch Hand

Joined: Mar 18, 2010
Posts: 39
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.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

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


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Jonh Smith
Ranch Hand

Joined: Mar 18, 2010
Posts: 39
Thank you very much for your help Ben!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: glassfish auto-generates unwanted session