tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pilho Kim <ph...@math.soongsil.ac.kr>
Subject Re: about the URL decoder of Tomcat 3.1
Date Thu, 01 Jan 1970 00:00:00 GMT

> > I think that
> > http://localhost:8080/ex%61mples/jsp/
> > http://localhost:8080/ex%61mples/jsp/
> > should be mapped to http://localhost:8080/examples/jsp/
>
> As for the query string of CGI script, characters other than [a-z][A-Z]
> must be converted as you think. And Tomcat can revert such a encoded
> character to the original one properly.
> But I'm not sure about the character within the request path.

Hi Inamori and everbody !

You may try by visiting http://jakarta.tomcat.org/tomcat
or refer RFC1738.

To solve the URL encoded path, I have modified the class
org.apache.tomcat.service.http.HttpRequestAdapter.

In the method readNextRequest(Response response) of the class HttpRequestAdapter,
modify as follows:

Original source
---------------
	int indexQ=requestString.indexOf("?");
	int rLen=requestString.length();
	if ( (indexQ >-1) && ( indexQ  < rLen) ) {
	    queryString = requestString.substring(indexQ + 1, requestString.length());
	    requestURI = requestString.substring(0, indexQ);
	} else {
	    requestURI= requestString;
	}

Modified source
---------------
	int indexQ=requestString.indexOf("?");
	int rLen=requestString.length();
	if ( (indexQ >-1) && ( indexQ  < rLen) ) {
	    queryString = requestString.substring(indexQ + 1, requestString.length());
	    requestURI = requestString.substring(0, indexQ);
	} else {
	    requestURI= requestString;
	}

+       if (requestURI != null && requestURI.indexOf('%') >= 0) {
+           requestURI = RequestUtil.URLDecode(requestURI);
+       }


Only three lines added as ablove.
it is my partial solution.
But there exist some multi-byte character problems
in the URL-Path under Tomcat webserver.
e.g.
    http://localhost:8080/<...multi-byte chars path...>?<querystring>

Such problems are common to every releases of Tomcat (3.0 ~ 3.1 and cvs).

I hope that this information helps you.....


Thanks

--
Pilho Kim

(My last name is Kim, not Pilho.)




Mime
View raw message