-
1. Re: JSP sendRedirect broken from JSP welcome-file in subdir?
gregwilkins Sep 9, 2002 8:36 PM (in response to pichler.mi)I'm pretty sure that such welcome files are not legal and
your lucky that they work at all!
I would suggest that you keep the welcome files in the
current directory.
You can always create an index in the parent directory
that contains a meta redirect to the subdirectory.
If I was to make a change for this, it would be to
throw an exception is we saw such a welcome file. Sorry.
I'm going to ask JSR154 if they can clarify this in the 2.4 spec. -
2. Re: JSP sendRedirect broken from JSP welcome-file in subdir?
gregwilkins Sep 9, 2002 8:41 PM (in response to pichler.mi)Correcting myself a little....
a welcome file like you have /subdir/index.html
is not legal, but subdir/index.html is.
The spec says that a welcome file partial URI should
not contain a leading or trailing "/" -
3. Re: JSP sendRedirect broken from JSP welcome-file in subdir?
pichler.mi Sep 11, 2002 8:46 AM (in response to pichler.mi)It didn't work with subdir/Welcome.jsp either, but, OK, a welcome-file that redirects into another directory is probably a bad idea anyways.
Thus I have changed the welcome-file to plain Hello.jsp located in the root dir of the webapp (hello.war) which does
<% response.sendRedirect ("subdir/target.html"); %>
That seems legal to me and works for Jetty alone, but not with JBoss 3.0.2 when just requesting "/hello/" (or "/hello" whicht gets redirected to "/hello/"); Also notice the different value of request.getRequestURL() which is taken as base for the redirect.
BTW, the redirect works as expected when accessing "/hello/Hello.jsp" explicitly. The problem is only with a JSP welcome file performing a redirect.
--- Jetty alone ---
GET /hello/ HTTP/1.0
HTTP/1.1 302 Moved Temporarily
Server: Jetty/4.1.0RC4 (Windows 2000 5.0 x86)
Servlet-Engine: Jetty/4.1.0RC4 (Servlet 2.3; JSP 1.2; java 1.4.0)
Location: http://192.168.x.y:8080/hello/subdir/target.html
Server Info: Jetty/4.1.0RC4
Request URI: /hello/Hello.jsp
Full URL: http://192.168.x.y:8080/hello/Hello.jsp
--- JBoss+Jetty ---
GET /hello/ HTTP/1.0
HTTP/1.1 302 Moved Temporarily
Server: Jetty/RELEASE_MAJOR_MINOR (Linux 2.4.18-64GB-SMP i386)
Servlet-Engine: Jetty/RELEASE_MAJOR_MINOR (Servlet 2.3; JSP 1.2; java 1.4.0)
Location: http://192.168.x.y:8080/subdir/target.html
Server Info: Jetty/RELEASE_MAJOR_MINOR
Request URI: /hello/Hello.jsp
Full URL: http://192.168.x.y:8080/hello/ -
4. Re: JSP sendRedirect broken from JSP welcome-file in subdir?
pichler.mi Sep 11, 2002 8:50 AM (in response to pichler.mi)[Think I've hit the wrong reply button the first thime. Sorry if you see this twice.]
It didn't work with subdir/Welcome.jsp either, but, OK, a welcome-file that redirects into another directory is probably a bad idea anyways.
Thus I have changed the welcome-file to plain Hello.jsp located in the root dir of the webapp (hello.war) which does
<% response.sendRedirect ("subdir/target.html"); %>
That seems legal to me and works for Jetty alone, but not with JBoss 3.0.2 when just requesting "/hello/" (or "/hello" whicht gets redirected to "/hello/"); Also notice the different value of request.getRequestURL() which is taken as base for the redirect.
BTW, the redirect works as expected when accessing "/hello/Hello.jsp" explicitly. The problem is only with a JSP welcome file performing a redirect.
--- Jetty alone ---
GET /hello/ HTTP/1.0
HTTP/1.1 302 Moved Temporarily
Server: Jetty/4.1.0RC4 (Windows 2000 5.0 x86)
Servlet-Engine: Jetty/4.1.0RC4 (Servlet 2.3; JSP 1.2; java 1.4.0)
Location: http://192.168.x.y:8080/hello/subdir/target.html
Server Info: Jetty/4.1.0RC4
Request URI: /hello/Hello.jsp
Full URL: http://192.168.x.y:8080/hello/Hello.jsp
--- JBoss+Jetty ---
GET /hello/ HTTP/1.0
HTTP/1.1 302 Moved Temporarily
Server: Jetty/RELEASE_MAJOR_MINOR (Linux 2.4.18-64GB-SMP i386)
Servlet-Engine: Jetty/RELEASE_MAJOR_MINOR (Servlet 2.3; JSP 1.2; java 1.4.0)
Location: http://192.168.x.y:8080/subdir/target.html
Server Info: Jetty/RELEASE_MAJOR_MINOR
Request URI: /hello/Hello.jsp
Full URL: http://192.168.x.y:8080/hello/ -
5. Re: JSP sendRedirect broken from JSP welcome-file in subdir?
pichler.mi Oct 1, 2002 11:02 AM (in response to pichler.mi)It works well with jboss 3.0.3 (bug 611044 closed)
for both the hello example and our application with a
welcome-file in a subdirectory (without leading /).
Thanks.
--- JBoss 3.0.3 + Jetty 4.1.0 ---
GET /hello/ HTTP/1.0
HTTP/1.1 302 Moved Temporarily
Server: Jetty/4.1.0 (Windows 2000 5.0 x86)
Servlet-Engine: Jetty/4.1.0 (Servlet 2.3; JSP 1.2; java 1.4.1)
Location: http://192.168.x.y:8080/hello/subdir/target.html
Request URI: /hello/Hello.jsp
Full URL: http://192.168.x.y:8080/hello/Hello.jsp
--- JBoss 3.0.3 + Tomcat 4.1.12 ---
GET /hello/ HTTP/1.0
HTTP/1.1 302 Moved Temporarily
Server: Apache Tomcat/4.1.12-LE-jdk14 (HTTP/1.1 Connector)
Location: http://localhost:8080/hello/Hello.jsp
<h1>HTTP Status 302 - Moved Temporarily</h1>
GET /hello/Hello.jsp HTTP/1.0
HTTP/1.1 302 Moved Temporarily
Server: Apache Tomcat/4.1.12-LE-jdk14 (HTTP/1.1 Connector)
Location: http://localhost:8080/hello/subdir/target.html