wood burning stoves 2.0*
The moose likes Servlets and the fly likes Get internal HTML link from HttpServletRequest object? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Get internal HTML link from HttpServletRequest object?" Watch "Get internal HTML link from HttpServletRequest object?" New topic
Author

Get internal HTML link from HttpServletRequest object?

Warren Weis
Greenhorn

Joined: Jul 18, 2011
Posts: 2
I have a link like

http://www.somehost.com/somepage.html#n521560

I need to capture the #n521560 ( the internal HTML link ), but I've been unable to find the component of the HTTPServletRequest that stores this.

I've tried

getRequestURI()
getQueryString()
getContextPath()
getPathInfo()
getRequestURL()
getPathTranslated()
getServletPath()

but no luck so far.
I wish this was a query parameter, but it is not.
I need to make some new code compatible with an application that is depending on the
old code's behavior.

Anyone know what component of HTTPServletRequest stores this? (Or some other object).
Thanks,

George

Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29249
    
139

Welcome to CodeRanch!

As far as I know, you can't get that information in a servlet. It is only used by the front end HTML page itself.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Warren Weis
Greenhorn

Joined: Jul 18, 2011
Posts: 2
Thank you for the prompt reply and welcome.
I will try and capture this portion of the URL using a rewrite rule.

However, it does seem to me that there ought to be some way to get the complete request URL as it originally arrived at the server.

thanks,

George
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Get internal HTML link from HttpServletRequest object?
 
Similar Threads
Is it possible to pass an object in a request from one app server to another?
problems running jsp1.2 ...
What's the best way to search in this specific type of List?
looking for some caching design patterns
What combination of frameworks most closely resemles WebOjects