Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6154251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:14:00+00:00 2026-05-23T20:14:00+00:00

In a Java web project, how can I get (if possible) the HTTP anchor

  • 0

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&param2=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&param2=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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T20:14:01+00:00Added an answer on May 23, 2026 at 8:14 pm

    I don’t think the anchor part is send to the server. It is only processed by the browser. Maybe you can extract it using JavaScript.

    According to RFC 1808:

    Note that the fragment identifier (and the “#” that precedes it) is
    not considered part of the URL.

    From http://iwebdevel.com/2009/06/10/javascript-get-anchor-from-url/

    var url=window.location;
    var anchor=url.hash; //anchor with the # character  
    var anchor2=url.hash.substring(1); //anchor without the # character
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For a new Java web project I thought about using: Eclipse as IDE Mercurial
Almost every new Java-web-project is using a modern MVC-framework such as Struts or Spring
I am using hudson CI to manage a straight java web project, using ant
I'm currently working on a WebSphere 6.1 Web Project. In my java code, how
I'm working on a web app project (in java; not that it matters) and
Im porting a project from php to java. The project is a web-app based
We are building a (Java) web project with Eclipse. By default Eclipse uses Cp1252
We have a java web service application that uses log4j to do logging. An
In a Java web application I have a recurring message load of type A
I'm developing (another) java web framework for personal use, and in addition to that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.