In a Java web project, how can I get (if possible) the "HTTP anchor" part in a URL request?
For example, when the request URL is http://localhost:8080/servlet/page.htm?param1=value1¶m2=value2#section I want to be able to recognize the #section
part.
public void doGet
(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
// ...
System.out.println("QueryString = " + request.getQueryString());
// ...
}
The example above produces the substring preceeding the #
, in this case: param1=value1¶m2=value2
. Is there a way to extract the part of the URL after the #
sign?
If this is of any use, I'm using the Apache Click framework.