You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Amrhein, Thomas" <ta...@debis.com> on 2000/03/28 14:21:20 UTC
good and bad news (AW: sendRedirect() through Apache does fail)
Good and bad news:
the good news where my fault.
In my apache's httpd.conf was a wrong ServerName.
sendRedirect tries to connect to the server, which is written there.
I forgot to overwrite the default value.
Now, nearly everything is right :-))))
the bad news:
I think, that the behavour of sendRedirect() is not correct:
I call
<%
request.sendRedirect("/admin/login/login.jsp");
return;
%>
relative to the apache server where "admin" is my servlet context in tomcat.
Same way, I can call
<jsp:forward page="/login/login.jsp" />
But here, no servlet context is needed in the URL.
Isn't jsp:forward the same as sendRedirect?
Why do they expect different URLs?
Is it a bug?
What do you say?
TA
-----Ursprüngliche Nachricht-----
Von: Peter Storch
Gesendet am: Dienstag, 28. März 2000 11:17
An: tomcat-user@jakarta.apache.org
Betreff: Antwort: AW: sendRedirect() through Apache does fail
Where is your jsp Page located?
If I place a jsp Page in the Apache htdocs directory it is not found.
But if I place the Page in tomcat/webapps/ROOT it is found and
sendRedirect()
works just fine.
"Amrhein, Thomas" <ta...@debis.com> am 28.03.2000 09:34:45
Bitte antworten an tomcat-user@jakarta.apache.org
An: tomcat-user@jakarta.apache.org
Kopie: (Blindkopie: Peter Storch/501500/Extern/BfG-Bank-AG)
Thema: AW: sendRedirect() through Apache does fail
Re: good and bad news (AW: sendRedirect() through Apache does fail)
Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
"Amrhein, Thomas" wrote:
> [snip]
> the bad news:
>
> I think, that the behavour of sendRedirect() is not correct:
>
> I call
> <%
> request.sendRedirect("/admin/login/login.jsp");
> return;
> %>
> relative to the apache server where "admin" is my servlet context in tomcat.
>
>
> Same way, I can call
> <jsp:forward page="/login/login.jsp" />
>
> But here, no servlet context is needed in the URL.
> Isn't jsp:forward the same as sendRedirect?
> Why do they expect different URLs?
> Is it a bug?
>
The sendRedirect() argument is required (by the HTTP protocol) to be an absolute
path (relative to the server's root). On the other hand, the
RequestDispatcher.forward() argument is required (by the servlet 2.2
specification) to be relative to the context root of the web application you are
running it from. Thus, they are not the same.
Craig McClanahan