struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Semprebon" <sempre...@eqsystems.com>
Subject Re: Incorrect (?) handling of path identification when using Apache+Tomcat+Struts
Date Thu, 05 Oct 2000 20:04:12 GMT
I got the same error. In my case, the 400 error was coming from Apache, not
Tomcat. Under the "Smart" context redirection, Apache was handling
everything but jsps (URI matching "*.jsp") and what it thought were servlets
(URI matching "*/servlet/*". The URI used by struts didn'ty fit the pattern,
so Apache never sent them to Tomcat. I ended up going to a minimalist
configuration, but I assume you could also direct Apache to send *.do URIs
to Tomcat, or change Strut's URIs to servler/*.

----- Original Message -----
From: "Christophe Thiebaud" <cthiebaud@stylo.it>
To: <struts-user@jakarta.apache.org>
Sent: Wednesday, October 04, 2000 6:07 AM
Subject: Incorrect (?) handling of path identification when using
Apache+Tomcat+Struts


> 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
described
> in
>
http://jakarta.apache.org/tomcat/jakarta-tomcat/src/doc/tomcat-apache-howto.
html
>
> 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