tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Rimov" <>
Subject JSPs forcing session ID to be created?
Date Sun, 25 Jun 2006 11:08:09 GMT
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="" prefix="c" %>
		<h1>Sample Form</h1>

Here's the relevant stack trace.

	RequestFacade.getSession(boolean) line: 822	
ApplicationHttpRequest(HttpServletRequestWrapper).getSession(boolean) line:
	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	
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

      _jspxFactory = JspFactory.getDefaultFactory();
      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!


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message