Mantis - Resin
Viewing Issue Advanced Details
3295 minor always 01-23-09 16:43 05-06-09 11:29
ferg  
ferg  
normal  
closed  
fixed  
none    
none 3.1.10  
0003295: getRequestURI and rewrite-dispatch
(rep by Ethan Larson)


<cluster>
...
     <web-app-default>
         <rewrite-dispatch>
            <dispatch />
         </rewrite-dispatch>
      </web-app-default>

      <host id="">
         <web-app id="/">
         </web-app>
      </host>

      <host id="testhost" root-directory="webapps">
         <web-app id="/">
            <servlet-regexp url-regexp="/test/*" servlet-class="com.remilon.servlets.BasicTestServlet">
            </servlet-regexp>
         </web-app>
      </host>
</cluster>

Servlet source code:

public class BasicTestServlet implements Servlet {
...

    public void service(ServletRequest servletRequest, ServletResponse servletResponse)
     throws ServletException, IOException {
        HttpServletRequest request = (HttpServletRequest)servletRequest;
        HttpServletResponse response = (HttpServletResponse)servletResponse;

        System.out.println("dest URI: " + request.getRequestURI());
        System.out.println("dest URL: " + request.getRequestURL().toString());

        response.getWriter().write("URI: " + request.getRequestURI());
        response.flushBuffer();
    }
...
}

With the rewrite-dispatch tag in place, I get this printed in the log for a request to http://testhost/test/some-page%3f.html: [^]

dest URI: /test/some-page
dest URL: http://testhost/test/some-page [^]

When I comment out the rewrite-dispatch tag, I get the correct URL:

dest URI: /test/some-page%3f.html
dest URL: http://testhost/test/some-page%3f.html [^]

Let me know if there's anything else I can do.


Notes
(0003903)
ferg   
03-18-09 19:13   
server/1ks{8,9}
(0003965)
ferg   
04-22-09 13:26   
reopen for 3.1.9