You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by ha...@mailnull.com on 2007/01/12 20:07:34 UTC

How can I get the unparsed URI from inside a servlet

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.

Thanks for your consideration.
- Marc


----------
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@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


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

Posted by Tim Funk <fu...@joedog.org>.
What about HttpServletRequest.getRequestURI()?

-Tim

happyharris.tomcatlist@mailnull.com wrote:
> 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.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org