public class URLParser
extends java.lang.Object
http://www.toolbox.com/index.html#answer1
The reference indicates that after the specified resource is retrieved, the application is specifically interested in that part of the document that has the tag answer1 attached to it.
For example, the following URL string can be parsed into its individual components:
http://myWebSite.com/servlet/myServlet#2043562?parm1="/library/test1#partA"
Here are the individual pieces of the URL:
URL: http://myWebSite.com/servlet/myServlet#2043562?parm1="/library/test1#partA" URI: http://myWebSite.com/servlet/myServlet Reference: 2043562 Parameter: {parm1="/library/test1#partA"}
Constructor and Description |
---|
URLParser(java.lang.String url)
Constructs a URLParser object with the specified url.
|
Modifier and Type | Method and Description |
---|---|
HTMLHyperlink |
getHTMLHyperlink(java.lang.String text)
Returns the HTMLHyperlink.
|
java.util.Properties |
getParameters()
Returns the parameters.
|
java.lang.String |
getReference()
Returns the reference, also known as the "anchor".
|
ServletHyperlink |
getServletHyperlink(java.lang.String text)
Returns the ServletHyperlink.
|
java.lang.String |
getURI()
Returns the URI.
|
static java.lang.String |
getURI(javax.servlet.http.HttpServletRequest request)
Returns the URI from the specified request.
|
java.lang.String |
getURL()
Returns the URL.
|
public URLParser(java.lang.String url)
url
- The url to parse.public java.lang.String getURL()
public java.lang.String getURI()
public static java.lang.String getURI(javax.servlet.http.HttpServletRequest request)
request
- The HttpServletRequest.public java.lang.String getReference()
public java.util.Properties getParameters()
public HTMLHyperlink getHTMLHyperlink(java.lang.String text)
text
- public ServletHyperlink getServletHyperlink(java.lang.String text)
text
-