You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Peter Thorsager <pt...@netobjects.com> on 2001/02/02 11:51:01 UTC
Problem with extra path info not redirected to servlet
Hi, I've looked through the archieves for info on this problem, but the only one that came close had a solution that does not work for me, let me explain:
I use Tomcat 3.2 to run a servlet located at "http://localhost/servlet", the servlet name is nexus. It is currently setup with an entry in server.xml:
<Context path="/servlet" docBase="e:/src/java/speedo" debug="10000" crossContext="true" reloadable="true"></Context>
and a web.xml file in "e:/src/java/speedo/WEB-INF":
<web-app>
<servlet>
<servlet-name>nexus</servlet-name>
<servlet-class>com.netobjects.nebula.connectionmanager.ConnectionServlet</servlet-class>
<init-param>
<param-name>nasPropertiesPath</param-name>
<param-value>e:\src\java\speedo\WEB-INF</param-value>
</init-param>
<load-on-startup></load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>nexus</servlet-name>
<url-pattern>/nexus</url-pattern>
</servlet-mapping>
</web-app>
The servlet works fine when I post requests like: http://localhost/servlet/nexus?cmd=blabla , but when I do a http://localhost/servlet/nexus/file , Tomcat goes into the e:/src/java/speedo/nexus/ directory and looks for a file named "file", INSTEAD of passing the extra path info to the servlet so that I can get a hold of it with HttpServletRequest.getPathInfo() as I would expect it to do.
Can anyone explain to me why Tomcat does this and how I can fix?
Greetings
Peter Thorsager
PS: I can get the examples in Tomcat to work correct, like the RequestInfoExample.
Re: Problem with extra path info not redirected to servlet
Posted by Peter Thorsager <pt...@netobjects.com>.
Thanks, that did it. Boy have I spent a lot of time trying to figure that
out :O
Peter Thorsager
----- Original Message -----
From: "Holger Hartwig" <H....@bmsg.de>
To: <to...@jakarta.apache.org>
Sent: Friday, February 02, 2001 12:09
Subject: Re: Problem with extra path info not redirected to servlet
> Peter,
> change
> <servlet-mapping>
> <servlet-name>nexus</servlet-name>
> <url-pattern>/nexus</url-pattern>
> </servlet-mapping>
> to
> <servlet-mapping>
> <servlet-name>nexus</servlet-name>
> <url-pattern>/nexus/*</url-pattern>
> </servlet-mapping> ^
> |
> then it should work
> Holger
>
>
> Peter Thorsager wrote:
> >
> > Part 1.1 Type: Plain Text (text/plain)
> > Encoding: quoted-printable
> >Hi, I've looked through the archieves for info on this problem, but the
only one that came close >had a solution that does not work for me, let me
explain:
> >
> >I use Tomcat 3.2 to run a servlet located at "http://localhost/servlet",
the servlet name is >nexus. It is currently setup with an entry in
server.xml:
> >
> ><Context path="/servlet" docBase="e:/src/java/speedo" debug="10000"
crossContext="true" >reloadable="true"></Context>
> >
> >and a web.xml file in "e:/src/java/speedo/WEB-INF":
> >
> ><web-app>
> <servlet>
> <servlet-name>nexus</servlet-name>
>
>
<servlet-class>com.netobjects.nebula.connectionmanager.ConnectionServlet</se
rvlet-class>
> <init-param>
> <param-name>nasPropertiesPath</param-name>
> <param-value>e:\src\java\speedo\WEB-INF</param-value>
> </init-param>
>
> <load-on-startup></load-on-startup>
> </servlet>
>
> <servlet-mapping>
> <servlet-name>nexus</servlet-name>
> <url-pattern>/nexus</url-pattern>
> </servlet-mapping>
>
> ></web-app>
> >
> >The servlet works fine when I post requests like:
http://localhost/servlet/nexus?cmd=blabla , but >when I do a
http://localhost/servlet/nexus/file , Tomcat goes into the
e:/src/java/speedo/nexus/ >directory and looks for a file named "file",
INSTEAD of passing the extra path info to the >servlet so that I can get a
hold of it with HttpServletRequest.getPathInfo() as I would expect it >to
do.
> >
> >Can anyone explain to me why Tomcat does this and how I can fix?
> >
> >Greetings
> >Peter Thorsager
> >
> >PS: I can get the examples in Tomcat to work correct, like the
RequestInfoExample.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, email: tomcat-user-help@jakarta.apache.org
Re: Problem with extra path info not redirected to servlet
Posted by Holger Hartwig <H....@bmsg.de>.
Peter,
change
<servlet-mapping>
<servlet-name>nexus</servlet-name>
<url-pattern>/nexus</url-pattern>
</servlet-mapping>
to
<servlet-mapping>
<servlet-name>nexus</servlet-name>
<url-pattern>/nexus/*</url-pattern>
</servlet-mapping> ^
|
then it should work
Holger
Peter Thorsager wrote:
>
> Part 1.1 Type: Plain Text (text/plain)
> Encoding: quoted-printable
>Hi, I've looked through the archieves for info on this problem, but the only one that came close >had a solution that does not work for me, let me explain:
>
>I use Tomcat 3.2 to run a servlet located at "http://localhost/servlet", the servlet name is >nexus. It is currently setup with an entry in server.xml:
>
><Context path="/servlet" docBase="e:/src/java/speedo" debug="10000" crossContext="true" >reloadable="true"></Context>
>
>and a web.xml file in "e:/src/java/speedo/WEB-INF":
>
><web-app>
<servlet>
<servlet-name>nexus</servlet-name>
<servlet-class>com.netobjects.nebula.connectionmanager.ConnectionServlet</servlet-class>
<init-param>
<param-name>nasPropertiesPath</param-name>
<param-value>e:\src\java\speedo\WEB-INF</param-value>
</init-param>
<load-on-startup></load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>nexus</servlet-name>
<url-pattern>/nexus</url-pattern>
</servlet-mapping>
></web-app>
>
>The servlet works fine when I post requests like: http://localhost/servlet/nexus?cmd=blabla , but >when I do a http://localhost/servlet/nexus/file , Tomcat goes into the e:/src/java/speedo/nexus/ >directory and looks for a file named "file", INSTEAD of passing the extra path info to the >servlet so that I can get a hold of it with HttpServletRequest.getPathInfo() as I would expect it >to do.
>
>Can anyone explain to me why Tomcat does this and how I can fix?
>
>Greetings
>Peter Thorsager
>
>PS: I can get the examples in Tomcat to work correct, like the RequestInfoExample.