I have a simple servlet running in Tomcat 7.0.56 that does:

   String  pathInfo = request.getPathInfo();
   // .... null check, logging, and other processing omitted
   RequestDispatcher  dispatcher = request.getRequestDispatcher(
   pathInfo );
   // .... other checks omitted
   dispatcher.forward( request, response );

I'm now getting complaints that this does not work properly when the URI path (after the servlet portion of the path, which is, of course omitted) contains special URL-encoded characters.

The spec is utterly vague about whether the input to getRequestDispatcher() should be encoded or decoded -- yet this clearly makes a critical difference!

Reading the Tomcat 7.0.56 source code, however, it seems quite clear that at least that version of the implementation expects the path to be encoded, but I'm not clear if this is correct or just the way it's currently working.

Looking through the archives I see that a similar question was raised around last June or so ("Decoded URL set on asynchronous request"), but I don't see any resolution to the issue.

Can someone please confirm that the Tomcat 7.0.56 behavior in this regard is the correct, standard/portable behavior?

--
Jess Holle

Reply via email to