You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jason Johnston <Ja...@epa.state.il.us> on 2002/12/18 16:05:21 UTC

How do I get the requested page from the Request Object?

 
I'm just a little curious on this and I'm sure there's a simple answer.
 I've mapped a servlet with the following path "/inventory/*" which
seems to be working fine.  The servler sends the request to the servlet.
 However, I'm having trouble getting the page request from the request
object.  I'm just looking for index.html or similar value but I'm having
trouble getting to it.
 
The following methods return the following results:
Servlet Path: /inventoryContext Path: /boastuff Request URL:
http://localhost:8080/boastuff/inventory/index.html Request URI:
/boastuff/inventory/index.html Session ID: null 
 
In the example I'm looking at request.getServletPath is used to
retrieve the index.html.  However, on mine it never gives that.  Do I
need to parse the Request URI or Request URL to get the actual page
request or is there a method I'm not finding?
 

Re: How do I get the requested page from the Request Object?

Posted by Bill Barker <wb...@wilshire.com>.
John's suggestions work, and I would probably use something like that
myself.

The alternative would be to use 'request.getPathInfo()' to return the part
of the URL after the '/inventory/' and before the query-string (if any).

"Jason Johnston" <Ja...@epa.state.il.us> wrote in message
news:se003a6a.080@admisd3.adm.epa.state.il.us...
>
> I'm just a little curious on this and I'm sure there's a simple answer.
>  I've mapped a servlet with the following path "/inventory/*" which
> seems to be working fine.  The servler sends the request to the servlet.
>  However, I'm having trouble getting the page request from the request
> object.  I'm just looking for index.html or similar value but I'm having
> trouble getting to it.
>
> The following methods return the following results:
> Servlet Path: /inventoryContext Path: /boastuff Request URL:
> http://localhost:8080/boastuff/inventory/index.html Request URI:
> /boastuff/inventory/index.html Session ID: null
>
> In the example I'm looking at request.getServletPath is used to
> retrieve the index.html.  However, on mine it never gives that.  Do I
> need to parse the Request URI or Request URL to get the actual page
> request or is there a method I'm not finding?
>
>





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>