tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anand Prasad" <axpra...@hotmail.com>
Subject Exception thrown when Forwarding
Date Thu, 12 Oct 2000 23:39:59 GMT
Hi

I store a session variable and basically check in every page whether that 
varibale contains any value.

When the user directly wants to enter the url without logging, I would like 
to redirect him to login page.

Here is code snippet.
//
<% if((String)session.getValue("loginId")==null){ %>
      <jsp:forward page="/login.htm" />
<% } %>

It throws up an exception in apache and tomcat.

I think I am making very stupid mistake...but unable to figure it.

Any suggestions, Thanks

javax.servlet.ServletException: Cannot forward as OutputStream or Writer has 
already been obtained
        at java.lang.Throwable.fillInStackTrace(Native Method)
        at java.lang.Throwable.fillInStackTrace(Compiled Code)
        at java.lang.Throwable.(Compiled Code)
        at java.lang.Exception.(Compiled Code)
        at javax.servlet.ServletException.(ServletException.java:161)
        at 
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:386)
        at 
dv._0002fdv_0002fsecurity_0002ejspsecurity_jsp_2._jspService(_0002fdv_0002fsecurity_0002ejspsecurity_jsp_2.java:92)
        at 
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
        at javax.servlet.http.HttpServlet.service(Compiled Code)
        at 
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:174)
        at org.apache.jasper.runtime.JspServlet.serviceJspFile(Compiled 
Code)
        at org.apache.jasper.runtime.JspServlet.service(Compiled Code)
        at javax.servlet.http.HttpServlet.service(Compiled Code)
        at org.apache.tomcat.core.ServletWrapper.handleRequest(Compiled 
Code)
        at 
org.apache.tomcat.core.RequestDispatcherImpl.include(RequestDispatcherImpl.java:262)
        at org.apache.jasper.runtime.PageContextImpl.include(Compiled Code)
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


Mime
View raw message