Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Apache Tomcat »

RE: How can I get the unparsed URI from inside a servlet

happyharris tomcatlist

2007-01-15


HttpServletRequest.getRequestURI() does not provide the unparsed URI.

1) It does not include the query string
2) You cannot tell if the URL has a question mark in it, if there is no query string (e.g. http://foo/bar? And http://foo/bar look the same).
3) You cannot tell if the session ID came from the URL or a cookie.

Thanks,
- Marc

Tim Funk wrote:
> What about HttpServletRequest.getRequestURI()?
>
> -Tim

> happyharris.tomcatlist@(protected):
> > Is it possible to get the unparsed URI from inside the service method
> > of an HttpServlet? I am using tomcat 5.5.9.
> >
> > I notice that the HttpServletRequest parameter to this method is
> > - implemented by org.apache.catalina.connector.RequestFacade,
> > - which contains a org.apache.catalina.connector.RequestFacade object,
> > - which contains a org.apache.coyote.Request object,
> > - which as a field called unparsedURIMB, which is the data that I want.
> >
> > In other words, I can see the information in the debugger, but there
> > is no way that I can find to access it.
> >
> > In case anyone is interested, the reason I need this data is that I am
> > writing a proxy server that gets its results by looking up URLs in a
> > previously populated database, rather than fetching them. Unless the
> > URL matches exactly, it will not be found. Being semantically
> > equivalent (such as the URL returned by
> > HttpServletRequest.getRequestURL) is not a good enough match.
> >
> > A way to get this data through proper APIs would be nice, but a hack
> > would be useful too.



----------
This message was sent from a MailNull anti-spam account. You can get
your free account and take control over your email by visiting the
following URL.

 http://mailnull.com/

---------------------------------------------------------------------
To start a new topic, e-mail: users@(protected)
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.