struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Windley" <wind...@imall.com>
Subject Re: Incorrect (?) handling of path identification when using Apache+Tomcat+Struts
Date Wed, 04 Oct 2000 13:36:37 GMT



For what its worth, I got these error consistently using Tomcat with Struts
0.5.  Changing to the latest beta of struts solved the problem.

--phil--

On Wed, 4 Oct 2000 12:07:48 +0200 Christophe Thiebaud writes
+--------------------
| Hi everybody,
| 
| when I access my 'foo' struts-based application through
| http://foo.com:8080/foo
| everything works fine 
| 
| when I use apache in 'Apache-Tomcat Smart Context Redirection' as in describe
d
| in
| http://jakarta.apache.org/tomcat/jakarta-tomcat/src/doc/tomcat-apache-howto.h
tml
| 
| struts will not handle the requests in the form :
| http://foo.com/foo/something.do
| but reply instead "Error:400 Invalid Path was requested"
| 
| Debbuging the code for ActionServlet
| I see that request.getPathInfo()
| returns null when called directly by tomcat
| and "" when called through Apache
| 
| so the following test in ActionServlet (#1252)
| > // For prefix matching, we want to match on the path info (if any)
| > path = request.getPathInfo();
| > if (path != null)
| >     return (path);
| returns an empty path, thus the error.
| 
| shouldn't this code be:
| > // For prefix matching, we want to match on the path info (if any)
| > path = request.getPathInfo();
| >(+) if (path != null && 0<path.length())
| >     return (path);
| 
| or am I mistaking something in my Apache-Tomcat Smart Context Redirection
| configuration ?
| 
| Christophe
| 


Mime
View raw message