SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2006
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Get anchor with JSP

    If i have an url like http://www.someurl.com/index.jsp#someAnchor


    can and how can i get the value of the anchor???
    NOTELAY.COM - Have a nice noty day
    ETA CONSULTING

  2. #2
    SitePoint Wizard rozner's Avatar
    Join Date
    Oct 2002
    Location
    Paris
    Posts
    1,058
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    use request.getQueryString() and then parse out everything after the #, there are several ways to do this. One easy way:
    Code:
    String query = request.getQueryString();
    int index = query.lastIndexOf('#');
    String anchor = query.substring(index);

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2006
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well this is not working... i read about this and it can't be done beacause anchors are not sent to the server, just url and query string are send... anyway thanks for the help rozner
    NOTELAY.COM - Have a nice noty day
    ETA CONSULTING


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •