tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher Williams" <ccwillia...@ntlworld.com>
Subject Re: response.sendRedirect
Date Fri, 05 Sep 2003 18:21:39 GMT
Say you're accessing pages on localhost, so your URLs take the form
    http://localhost:8080/war-file/jsp-file
then the servlet container root is http://localhost:8080/ and a redirect to
"/another-war-file/another.jsp" would be a redirect to:
    http://localhost:8080/another-war-file/another.jsp

In sendRedirect, I'm fairly sure that you simply use "/cal/form/index.jsp".
That sort of pattern always works for my webapps.

----- Original Message ----- 
From: "Charlie Toohey" <ctoohey@pacbell.net>
To: <tomcat-user@jakarta.apache.org>
Sent: Friday, September 05, 2003 7:07 PM
Subject: response.sendRedirect


> The Servlet API doc for the sendRedirect method states:
>
> "....If the location is relative with a leading '/' the container
interprets
> it as relative to the servlet container root....."
>
> I've looked thru the Servlet Spec and can not quite figure out what they
mean
> by servlet container root ? Is this a typo and supposed to be servlet
context
> root ? Or is there really such a thing as the servlet container root, and
if
> so, what is it ?
>
> e.g. if my context path is "/cal" and I want to redirect to
> "/cal/form/index.jsp", what would I use in sendRedirect ?
> (I know I could do a forward, but want to redirect in my situation)
>
> Thanks,
> Charlie
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>



Mime
View raw message