> -----Original Message-----
> From: Mark B. Indictor [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 27, 2002 1:17 PM
> To: 'Tomcat Users List'
> Subject: RE: REPOST: Please HELP!: URL Mapping Problems in servlet
> 
> 
> If the URL is: http://hostname/context/servlet/xxx
> 
> Then:
> 
> req.getPathInfo() returns:    /xxx
> req.getRequestURI() returns:  /context/servlet/xxx
> req.getServletPath() returns: /servlet
> 
> How do I get just: /context/servlet

I don't think there is a function to get the full request path without the
final page/servlet name. 

This should get what you need:
req.getRequestURI().substring(0,req.getRequestURI().lastIndexOf("/"))

> 
> OR
> 
> How do I get Apache or Tomcat to respond to: 
> http://hostname/servlet/xxx?
> 

tomcat will already take a servlet named 'xxx' in this format unless you
disabled the default servlet invoker in conf\web.xml. You will have to map
/servlet/* to tomcat from apache.

Charlie


> Thanks
> 
>     - mbi
> ======================================================
> Mark Indictor -- Site2 Corporation
> [EMAIL PROTECTED]
> <http://www.site2.com>
> Phone:(310)451-3472 FAX:(240)220-6341
> http://keyserver.pgp.com/pks/lookup?op=get&search=0x8959F966
> ====================================================== 
> 

--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to