tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jay Burgess <>
Subject Why ignore sendRedirect() for an include?
Date Mon, 20 May 2002 16:07:51 GMT
I started this discussion on the JSP list, but am led to believe now that 
this is a Tomcat issue.  Can someone explain otherwise?

My problem is that a sendRedirect() issued by my servlet is not being 
honored by Tomcat 4.0.3.  The servlet is being called via a <jsp:include> 
block from within a JSP.  The sendRedirect() is the first thing in my 
doGet().   As long as the response hasn't been committed, this should be 
legal, right?  (I confirmed that the response had not been committed with 
res.isCommitted() .)

To confuse me even more, I found the following in the Tomcat source 

      * Disallow <code>sendRedirect()</code> calls on an included response.
      * @param location The new location
      * @exception IOException if an input/output error occurs
     public void sendRedirect(String location) throws IOException {
         if (!included)
             ((HttpServletResponse) getResponse()).sendRedirect(location);

Can someone confirm that the reason my sendRedirect() is failing is because 
of the above (!included) check, and even more importantly, WHY you don't 
allow sendRedirect()'s on an included response?



To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message