5 Replies Latest reply on Oct 1, 2002 11:02 AM by Michael Pichler

    JSP sendRedirect broken from JSP welcome-file in subdir?

    Michael Pichler Newbie


      I just tried jboss 3.0.2 with jetty 1.4.

      Our webapp defines a welcome-file in a subdirectory, e.g.
      subdir/Welcome.jsp which should redirect to a relative location. When
      running it in tomcat or jetty standalone it works (it also worked with
      jboss 3.0.0 with tomcat), but with the combination above, the redirect
      URI is interpreted relative to the server root (even outside the
      application context), not the location of the jsp file.

      The difference (bug?) can also be observed with request.getRequestURL().

      A simplified version of the webapp is attacht as welcome.war. Any
      clues what's wrong? PS: We have found jboss a great product besides
      this minor glitch.

      --- subdir/Welcome.jsp ---
      <% response.sendRedirect ("target.html"); %>
      Server Info: <%= application.getServerInfo()%>
      Request URI: <%= request.getRequestURI()%>
      Full URL: <%= request.getRequestURL ()%>

      --- Jetty alone ---
      GET /welcome/ HTTP/1.0
      HTTP/1.1 302 Moved Temporarily
      Server: Jetty/4.0.5 (Windows 2000 5.0 x86)
      Servlet-Engine: Jetty/1.1 (Servlet 2.3; JSP 1.2; java 1.4.0)
      Location: http://192.168.x.y:8080/welcome/subdir/target.html

      Server Info: Jetty/1.1

      Request URI: /welcome/subdir/Welcome.jsp
      Full URL: http://192.168.xxx.xxx:8080/welcome/subdir/Welcome.jsp

      --- jboss 3.0.2 with jetty ---
      GET /welcome/ 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)

      Server Info: Jetty/RELEASE_MAJOR_MINOR
      Request URI: /welcome/subdir/Welcome.jsp
      Full URL: http://192.168.x.y:8080/welcome/