Re: session timeout not working anymore :(
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" %> 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) { %> <% } %> 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 <%@ 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:
Re: session timeout not working anymore :(
On Tue, 4 Feb 2003, Sundar Narasimhan wrote: > Date: Tue, 4 Feb 2003 23:35:38 -0500 > From: Sundar Narasimhan <[EMAIL PROTECTED]> > Reply-To: Tomcat Users List <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: session timeout not working anymore :( > > 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) { %> > > <% } %> > > 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" :) > That's the right answer :-). The exception is not happening in Struts, it is happening inside your page. > I'm running Tomcat 4.18 on Windows XP. > Thanks. > main.jsp > > <%@ 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" > %> > > > > > > > > class="composite"> > <%@ include file="header-inc.jsp" %> > > --- > javax.servlet.ServletException: class com.ascent.webapps.common.User : > java.lang.InstantiationException: com.ascent.webapps.common.User This is the key to the problem -- for some reason, the page is not able to create an instance of your "com.ascent.webapps.common.User" class. Why it is even trying to do so must be in some code you have not shown us yet, but the most common causes are: * You don't have a copy of this class visible to the webapp. * The class is not public. * The class does not have a public, no-args constructor. * Somewhere in the constructor, or one of the initialization expressions for your class's instance variables, an exception is getting thrown. Craig McClanahan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: session timeout not working anymore :(
I admit not not looking at this in detail. But the lack or a 'return;' statement after the jsp:forward is a major red flag. "Sundar Narasimhan" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > 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) { %> > > <% } %> > > 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 > > <%@ 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" > %> > > > > > > > > class="composite"> > <%@ 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(PageContextImp l.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:2 04) > 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(Application FilterChain.java:247) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) > at > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:260) > at > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(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.ja va:191) > at > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(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.invok eNext(StandardPipeline.java:643) > at > org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java:170) > at > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) > at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172 ) > at > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(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.invok eNext(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.processConne ction(Http11Protocol.java:386) > at > org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534) > at > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:530) > at java.lang.Thread.run(Thread.java:536 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]