In your jsp
<%@ page session="false">
Is this what you're looking for??

Martin --

This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- From: "Pid" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Sunday, June 25, 2006 8:40 AM
Subject: Re: JSPs forcing session ID to be created?


I think Tomcat creates a session, unless you tell it otherwise.


http://wiki.jboss.org/wiki/Wiki.jsp?page=DisableSessionPersistence

I repeat the popular refrain "Google is your friend."






Michael Rimov wrote:
Environment:  Tomcat 5.5.17 using http connector, Servlet API 2.4.

Hi All,

I'm not sure where to go from here, so I'm going to assume it's a Catalina
issue and go from there.

I was working on a front controller that wouldn't instantiate a session
unless absolutely necessary - (for scalability reasons) -- To my dismay,
I was seeing a session created anyway.

After some debugging, I came across the source of my problem:

The following JSP will generate a session token:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>
<html>
<head>
<title>Example</title>
</head>
<body>
<h1>Sample Form</h1>
</body>
</html>


Here's the relevant stack trace.


RequestFacade.getSession(boolean) line: 822

ApplicationHttpRequest(HttpServletRequestWrapper).getSession(boolean) line:
215
ApplicationHttpRequest.getSession(boolean) line: 544
ApplicationHttpRequest.getSession() line: 493
PageContextImpl._initialize(Servlet, ServletRequest,
ServletResponse, String, boolean, int, boolean) line: 148
PageContextImpl.initialize(Servlet, ServletRequest, ServletResponse,
String, boolean, int, boolean) line: 123
JspFactoryImpl.internalGetPageContext(Servlet, ServletRequest,
ServletResponse, String, boolean, int, boolean) line: 104
JspFactoryImpl.getPageContext(Servlet, ServletRequest,
ServletResponse, String, boolean, int, boolean) line: 61
Example.jsp line: not available
Example_jsp(HttpJspBase).service(HttpServletRequest,
HttpServletResponse) line: 97
Example_jsp(HttpServlet).service(ServletRequest, ServletResponse)
line: 802
JspServletWrapper.service(HttpServletRequest, HttpServletResponse,
boolean) line: 332

In this case, the boolean value for creating the session is true.


I got some raw source code (older tomcat) and the _jspService looked like
this:


      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


Is this really by design?  Bug?  Obviously, I'd rather not have a new
session created until I need it.

Is this situation submittable as a bug or am I misusing the library?

Thanks in advance!

-Mike





---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to