Hi,
I created a little test servlet and i get different behavior between
curl and Firefox.
I am guessing the the browser is not transmitting the fragment, which
is the correct behavior as the fragment is only meant for client use.
Curl, incorrectly transmits the fragment. Servlet gets confused
thinking the fragment is part of the URI path, for example
getPathInfo() returns the path with the fragment.
"Returns any extra path information associated with the URL the
client sent when it made this request. The extra path
information follows the servlet path but precedes the query string
and will start with a "/" character."
Paul.
On Aug 26, 2009, at 7:47 AM, Geoff hendrey wrote:
> Hi All,
>
> I am trying to access a fragment of a URI. For example, http://
> server:port/path#fragment
>
> The docs for ContainerRequest.getRequestURI indicate: "Get the
> absolute request URI. This includes query parameters and any
> supplied fragment."
>
> I've checked with curl in "--trace" mode to insure the fragment is
> actually sent to the server, so I am sure it is being sent as part
> of the URI.
>
> However, I don't get the fragment. I've tried virtually everything I
> can think of to get the fragment. Here is a partial list of what
> I've tried (on both HttpServletRequest, and ContainerRequest):
>
> log.debug(req.getRequestUri().getRawFragment());
> log.debug(req.getRequestUri().getPath());
> log.debug(req.getAbsolutePath());
> log.debug(req.getPath());
> log.debug(req.getRequestUri().getRawPath());
> log.debug(req.getRequestUri().getRawQuery());
>
> Can anyone tell me how to get the fragment?
>
> -geoff
>
>
>