tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Gainty <>
Subject RE: HttpServletResponse.sendRedirect() not working?
Date Tue, 17 Feb 2009 02:28:36 GMT

if you were forwarding..that would be a TC error

a redirect sends response back to browser-client  
its up to browser-client to then accept the response and re-direct the client Request to new

//an alternative strategy would be to build the URL consisting of URL and http-get parameters
String url_string =""+"&parm1=value1&parm2=value2";
//call the URL directly (essantially a forward as the session is preserved) url = new;
//read the response from url into Buffered Reader
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));

Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business of Sender.
This transmission is of a confidential nature and Sender does not endorse distribution to
any party other than intended recipient. Sender does not necessarily endorse content contained
within this transmission. 

> Date: Mon, 16 Feb 2009 17:55:09 -0800
> From:
> To:
> Subject: HttpServletResponse.sendRedirect() not working?
> I'm having a problem with Tomcat 6.0.18 that I don't understand. I'm invoking
> HttpServletResponse.sendRedirect() but no redirect is being sent to the
> browser. Is there a valid reason why this might occur, or is this likley a
> bug in Tomcat?
> My code has thrown an exception prior to invoking the redirect but I can't
> find anything in the Servlet spec that would indicate this is a problem. The
> HttpServletResponse.sendRedirect() is within a try/catch block and no
> exception is being thrown in response to sendRedirect(). My app is built on
> Grails (which in turn is built on top of Spring) and I don't fully
> understand the exception resolution process used by my frameworks, but I
> have verified that sendRedirect() is being executed and not throwing an
> exception. This same code is working as desired when executed on Jetty (i.e.
> the desired redirect is received by the browser) but when executed in Tomcat
> I see the default Tomcat error page displayed rather than the redirect.
> Any advice or suggestions would be appreciated.
> -- 
> View this message in context:
> Sent from the Tomcat - User mailing list archive at
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

See how Windows connects the people, information, and fun that are part of your life.
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message