tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean Dockery <s...@sbdconsultants.com>
Subject Re: session timeout not working anymore :(
Date Wed, 05 Feb 2003 06:02:46 GMT
What used to worked?  What behavior are you expecting that you no longer 
observe?

If I was to guess at what you're expecting to happen...  I would guess that 
you are expecting that getSession(false) would equal null at some point and 
that never happens?  This causes the useBean directive to fail.

Try including a page directive for the JSP page not to participate in 
sessions.  That is, insert the page directive before the DOCTYPE line.

<%@ page session="false" %><!DOCTYPE ...

If not otherwise instructed the JSP compiler will automatically create a 
new HttpSession object for you by inserting the call HttpSession = 
request.getSession(true) into your compiled JSP code.  Unless you suppress 
this behavior, your test in header-inc.jsp will always fail.

At 23:35 2003-02-04 -0500, you wrote:
>Hi, I'm running out of options -- but is there a problem with
>getSession(false)?
>
>Sigh. We used to have a piece of code included in our jsp's like so:
>----header-inc----
><% if (request.getSession(false) == null) { %>
>       <jsp:forward page="logout.jsp?TIMEOUT=60"> </jsp:forward>
><% } %>
><jsp:useBean id="user" scope="session" class="webapps.common.User"/>
>----header-inc----
>and that was included in our files like so. That used to work.. but
>now when I have struts-html and struts-bean.. it always fails.
>Is there something wrong with getSession(false) now?
>
>The stack doesn't seem to include the struts generated servlets.. so
>I'm really puzzled!!
>
>Any help will be much appreciated even if it's only to say.. "it's not
>struts" :)
>
>I'm running Tomcat 4.18 on Windows XP.
>Thanks.
>----main.jsp----
><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
><%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
><%@ page language="java" contentType="text/html; charset=ISO-8859-1" 
>pageEncoding="ISO-8859-1" %> <%@ include file="header-inc.jsp" %> --- 
>javax.servlet.ServletException: class com.ascent.webapps.common.User : 
>java.lang.InstantiationException: com.ascent.webapps.common.User at 
>org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:533)

>at org.apache.jsp.contactus_jsp._jspService(contactus_jsp.java:355) at 
>org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at 
>javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at 
>org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204) 
>at 
>org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) 
>at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at 
>javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at 
>org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)

>at 
>org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)

>at 
>org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260) 
>at 
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

>at 
>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 
>  at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) 
>at 
>org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 
>at 
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

>at 
>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 
>  at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) 
>at 
>org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) 
>at 
>org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) 
>at 
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

>at 
>org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)

>at 
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)

>at 
>org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172) 
>at 
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)

>at 
>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 
>  at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) 
>at 
>org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) 
>at 
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

>at 
>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 
>  at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) 
>at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) 
>at 
>org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432) 
>at 
>org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)

>at 
>org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534) 
>at 
>org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530) 
>at java.lang.Thread.run(Thread.java:536 
>--------------------------------------------------------------------- To 
>unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For 
>additional commands, e-mail: tomcat-user-help@jakarta.apache.org

Sean Dockery
sean@sbdconsultants.com
Certified Java Web Component Developer
Certified Delphi Programmer
SBD Consultants
http://www.sbdconsultants.com



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message