DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5114>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5114

The methods getPathInfo() and getRequestURL() of the HttpServletReguest interface 
gives different path information for Latin-1 characters not included in the english 
language. 

           Summary: The methods getPathInfo() and getRequestURL() of the
                    HttpServletReguest interface gives different path
                    information for Latin-1 characters not included in the
                    english language.
           Product: Tomcat 4
           Version: 4.0.1 Final
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Catalina
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


An URL containing swedish characters, like 'å', 'ä' or 'ö' which all are 
included in the Latin-1 set, gives different path information in the Tomcat 
4.01 implementation of the methods getPathInfo() and getRequestURL() of the 
HttpServletReguest interface. 

The getPathInfo() method seems to interpret the characters in a succesful 
manner while getRequestURL() fails. 
I wrote a wrapper method, using getPathInfo(), for the getRequestURL() to fix 
this:

public static String getRequestURLWrapper(HttpServletRequest req) 
{
  StringBuffer url  = new StringBuffer();
  String protocol = req.getScheme();
 
  url.append(protocol); 
  url.append("://");
  url.append(req.getServerName()); 

  int port = req.getServerPort(); 
  if ((protocol.equals("http") && (port != 80))
      || (protocol.equals("https") && (port != 443))) {
    url.append(':');
    url.append(port);
  }

  url.append(req.getServletPath());
 
  String pathInfo = req.getPathInfo();
  if (pathInfo != null) url.append(pathInfo); 

  return (url.toString());
}

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to