public class URLParser extends 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(String url)
Constructs a URLParser object with the specified url.
|
Modifier and Type | Method and Description |
---|---|
HTMLHyperlink |
getHTMLHyperlink(String text)
Returns the HTMLHyperlink.
|
Properties |
getParameters()
Returns the parameters.
|
String |
getReference()
Returns the reference, also known as the "anchor".
|
ServletHyperlink |
getServletHyperlink(String text)
Returns the ServletHyperlink.
|
String |
getURI()
Returns the URI.
|
static String |
getURI(javax.servlet.http.HttpServletRequest request)
Returns the URI from the specified request.
|
String |
getURL()
Returns the URL.
|
public URLParser(String url)
url
- The url to parse.public String getURL()
public String getURI()
public static String getURI(javax.servlet.http.HttpServletRequest request)
request
- The HttpServletRequest.public String getReference()
public Properties getParameters()
public HTMLHyperlink getHTMLHyperlink(String text)
public ServletHyperlink getServletHyperlink(String text)