tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Turner, John" <JTur...@AAS.com>
Subject RE: How do I get the requested page from the Request Object?
Date Wed, 18 Dec 2002 15:11:23 GMT

This should do the trick:

String requestURI = request.getRequestURI();
if (requestURI.indexOf("index.html") > 0) {
  // do something here
}

John

> -----Original Message-----
> From: Jason Johnston [mailto:Jason.Johnston@epa.state.il.us]
> Sent: Wednesday, December 18, 2002 10:05 AM
> To: tomcat-user@jakarta.apache.org
> Subject: 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?
>  
> 

--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message