You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Kito D. Mann" <km...@virtua.com> on 2005/07/30 04:37:53 UTC

Tomcat, getRequestURI(), and URL fragments

I've noticed an interest consequence of getRequestURI() with Tomcat -- 
getRequestURI() doesn't return the URL fragment (the part after the "#"). 
So, if the URL is http://www.foo.com/page.html#blah, getRequestURI() only 
returns "/page.html", as opposed to "/page.html#blah". Apache, however, 
knows the full URL (which is recorded in the logs). Can anyone tell me if 
this is normal behavior, and if there's a way to retrieve the URL fragment?

Environment: Linux, Tomcat 5.0.28, Apache w/mod_jk.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kito D. Mann (kmann@virtua.com)
Virtua, Inc.
Author, JavaServer Faces in Action 
(<http://www.manning.com/mann/index.html>http://www.manning.com/mann/index.html)
http://www.JSFCentral.com - JavaServer Faces FAQ, news, and info

"Existence doesn't necessarily mean living..."  

Re: Tomcat, getRequestURI(), and URL fragments

Posted by "Kito D. Mann" <km...@virtua.com>.
At 01:02 PM 7/30/2005, you wrote:
>The web browser never sends (or shouldn't send) #blah so the webserver 
>will never see it.
>
>-Tim

Ah. That's kind of what I was thinking. For some reason, some browsers do 
actually send it, so I was getting a little confused. Thanks.


>Kito D. Mann wrote:
>
>>I've noticed an interest consequence of getRequestURI() with Tomcat -- 
>>getRequestURI() doesn't return the URL fragment (the part after the "#"). 
>>So, if the URL is http://www.foo.com/page.html#blah, getRequestURI() only 
>>returns "/page.html", as opposed to "/page.html#blah". Apache, however, 
>>knows the full URL (which is recorded in the logs). Can anyone tell me if 
>>this is normal behavior, and if there's a way to retrieve the URL fragment?
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kito D. Mann
Author, JavaServer Faces in Action
http://www.JSFCentral.com - JSF FAQ, news, and info

Are you using JSF in a project? Send your story to trenches@jsfcentral.com, 
and you could get your story published and win a free copy of JavaServer 
Faces in Action!


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