Hi,
request.getSession(false) actually may not get u null,

for instance if u invalidate a session, then all the
values stored in session are removed, but u still get
the session, so it is not null
so i would suggest u not only check for session ==
null but also some value  u know ill be in session, 
if this attribute is also null, then u can forward the
request to logout
your code will look some thing like this
<% if (request.getSession(false) == null) { %>
       <jsp:forward page="logout.jsp?TIMEOUT=60">
 </jsp:forward>
<% 
}
if (request.getSession(false).getAttribute("myvalue"
== null) { %>
<jsp:forward page="logout.jsp?TIMEOUT=60">
 </jsp:forward>
<% 
}
%>

       
 %>

--- Sundar Narasimhan <[EMAIL PROTECTED]> wrote:
> 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" %>
> <html:html>
> <HEAD>
> <%@ page 
> language="java"
> contentType="text/html; charset=ISO-8859-1"
> pageEncoding="ISO-8859-1"
> %>
> <META http-equiv="Content-Type" content="text/html;
> charset=ISO-8859-1">
> <META name="GENERATOR" content="IBM WebSphere
> Studio">
> <META http-equiv="Content-Style-Type"
> content="text/css">
> <LINK href="theme/tigris.css" rel="stylesheet"
> type="text/css">
> <TITLE></TITLE>
> </HEAD>
> 
> <body marginwidth="0" marginheight="0"
> leftmargin="0" topmargin="0"
> 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(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:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


=====
A$HI$H

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to