On June 20, 2019 10:00:12 AM UTC, Tommy Pham <tommy...@gmail.com> wrote:

<snip/>

>> In looking at the code for ApplicationHttpRequest [1] for the
>> getPathTranlated()
>>
>>     @Override
>>     public String getPathTranslated() {
>>         if (getPathInfo() == null || getServletContext() == null) {
>>             return null;
>>         }
>>         return getServletContext().getRealPath(getPathInfo());
>>     }
>>
>> and for the getRequestDispatcher()
>>
>>         if (pathInfo == null) {
>>             requestPath = servletPath;
>>         } else {
>>             requestPath = servletPath + pathInfo;
>>                   }
>>
>> Perhaps the getPathTranslated() could be ?
>>
>> if ( getServletContext() != null) {
>>     if (getServletPath() != null) {
>>        if (getPathInfo() != null) {
>>
>>            return getServletContext().getRealPath(getServletPath() +
>> getPathInfo());
>>        }
>>        return getServletContext().getRealPath(getServletPath());
>>     }
>> }
>> return null;
>>
>> I think that would also fix the translated path I saw earlier which
>> resulted in a blank page for the browser.

Sorry, no. The Servlet spec defines the behaviour of those methods and Tomcat 
correctly implements the requirements of the Servlet spec.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to