public class ServletHyperlink extends HTMLHyperlink
This example creates an ServletHyperlink and displays the HTML tag.
ServletHyperlink link = new ServletHyperlink("http://www.myCompany.com", "myCompany Home Page"); link.setHttpServletResponse(resp); link.setPathInfo("/myServletDirectory/servlet"); System.out.println(link.getTag());
Here is the output of the ServletHyperlink:
<a href="http://www.myCompany.com/myServletDirectory/servlet&SomeSessionID=942349280740">myCompany Home Page</a>
This example creates an ServletHyperlink and sets two properties.
ServletHyperlink link = new ServletHyperlink("http://www.myCompany.com", "myCompany Home Page"); Properties properties = new Properties(); properties.put("userID", "fred"); properties.put("employeeID", "01234567"); link.setProperties(properties); link.setHttpServletResponse(resp); link.setPathInfo("/myServletDirectory/servlet"); System.out.println(link.getTag());
Here is the output of the ServletHyperlink:
<a href="http://www.myCompany.com/myServletDirectory/servlet?userid=fred&employeeID=01234567&SomeSessionID=942349280740">myCompany Home Page</a>
ServletHyperlink objects generate the following events:
ABSBOTTOM, ABSMIDDLE, BASELINE, BOTTOM, CAPITALS, CENTER, CIRCLE, DISC, JUSTIFY, LARGE_ROMAN, LEFT, LOWER_CASE, LTR, MIDDLE, NUMBERS, RIGHT, RTL, SMALL_ROMAN, SQUARE, TARGET_BLANK, TARGET_PARENT, TARGET_SELF, TARGET_TOP, TEXTTOP, TOP
Constructor and Description |
---|
ServletHyperlink()
Creates a default ServletHyperlink object.
|
ServletHyperlink(java.lang.String link)
Creates a ServletHyperlink object with the specified resource link.
|
ServletHyperlink(java.lang.String link,
java.lang.String text)
Creates a ServletHyperlink object with the specified resource link
represented by the specified text.
|
ServletHyperlink(java.lang.String link,
java.lang.String text,
java.lang.String target)
Creates a ServletHyperlink object with the specified resource link
and target frame represented by the specified text.
|
ServletHyperlink(java.lang.String link,
java.lang.String text,
java.lang.String target,
java.lang.String path,
javax.servlet.http.HttpServletResponse response)
Creates a ServletHyperlink object with the specified resource link, link text,
target frame, resource link path, and HTTPServlet response.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener.
|
java.lang.Object |
clone()
Returns a copy of the ServletHyperlink.
|
javax.servlet.http.HttpServletResponse |
getHttpServletResponse()
Returns the Http servlet response.
|
java.lang.String |
getPathInfo()
Returns the path information.
|
java.lang.String |
getTag()
Returns the HTML tag that represents the resource link.
|
java.lang.String |
getTag(java.lang.String text,
java.util.Properties properties)
Returns the HTML tag that represents the resource link
with the specified text and properties.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes the PropertyChangeListener from the internal list.
|
void |
setHttpServletResponse(javax.servlet.http.HttpServletResponse response)
Sets the Http servlet response for the resource link.
|
void |
setPathInfo(java.lang.String path)
Sets the path information for the resource link.
|
addVetoableChangeListener, getDirection, getFOTag, getLanguage, getLink, getLocation, getName, getProperties, getTag, getTarget, getText, getTitle, removeVetoableChangeListener, setDirection, setLanguage, setLink, setLocation, setName, setProperties, setTarget, setText, setTitle, toString
getAttributes, getAttributeString, setAttributes
public ServletHyperlink()
public ServletHyperlink(java.lang.String link)
link
- The Uniform Resource Identifier (URI).public ServletHyperlink(java.lang.String link, java.lang.String text)
link
- The Uniform Resource Identifier (URI).text
- The text representation for the resource.public ServletHyperlink(java.lang.String link, java.lang.String text, java.lang.String target)
link
- The Uniform Resource Identifier (URI).text
- The text representation for the resource.target
- The target frame.public ServletHyperlink(java.lang.String link, java.lang.String text, java.lang.String target, java.lang.String path, javax.servlet.http.HttpServletResponse response)
link
- The Uniform Resource Identifier (URI).text
- The text representation for the resource.target
- The target frame.path
- The resource link path information.response
- The Http servlet response.public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in class HTMLTagAttributes
listener
- The PropertyChangeListener.removePropertyChangeListener(java.beans.PropertyChangeListener)
public java.lang.Object clone()
clone
in class HTMLHyperlink
public javax.servlet.http.HttpServletResponse getHttpServletResponse()
public java.lang.String getPathInfo()
public java.lang.String getTag()
getTag
in interface HTMLTagElement
getTag
in class HTMLHyperlink
public java.lang.String getTag(java.lang.String text, java.util.Properties properties)
getTag
in class HTMLHyperlink
text
- The text.properties
- The Properties.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener
in class HTMLTagAttributes
listener
- The PropertyChangeListener.addPropertyChangeListener(java.beans.PropertyChangeListener)
public void setHttpServletResponse(javax.servlet.http.HttpServletResponse response)
response
- The Http servlet response.public void setPathInfo(java.lang.String path)
path
- The path information.