com.ibm.as400.util.servlet
Class ServletHyperlink

java.lang.Object
  extended bycom.ibm.as400.util.html.HTMLTagAttributes
      extended bycom.ibm.as400.util.html.HTMLHyperlink
          extended bycom.ibm.as400.util.servlet.ServletHyperlink
All Implemented Interfaces:
HTMLConstants, HTMLTagElement, Serializable

public class ServletHyperlink
extends HTMLHyperlink

The ServletHyperlink class represents an HTML hyperlink tag.

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:

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.ibm.as400.util.html.HTMLConstants
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 Summary
ServletHyperlink()
          Creates a default ServletHyperlink object.
ServletHyperlink(String link)
          Creates a ServletHyperlink object with the specified resource link.
ServletHyperlink(String link, String text)
          Creates a ServletHyperlink object with the specified resource link represented by the specified text.
ServletHyperlink(String link, String text, String target)
          Creates a ServletHyperlink object with the specified resource link and target frame represented by the specified text.
ServletHyperlink(String link, String text, String target, 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.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds a PropertyChangeListener.
 Object clone()
          Returns a copy of the ServletHyperlink.
 javax.servlet.http.HttpServletResponse getHttpServletResponse()
          Returns the Http servlet response.
 String getPathInfo()
          Returns the path information.
 String getTag()
          Returns the HTML tag that represents the resource link.
 String getTag(String text, Properties properties)
          Returns the HTML tag that represents the resource link with the specified text and properties.
 void removePropertyChangeListener(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(String path)
          Sets the path information for the resource link.
 
Methods inherited from class com.ibm.as400.util.html.HTMLHyperlink
addVetoableChangeListener, getDirection, getFOTag, getLanguage, getLink, getLocation, getName, getProperties, getTag, getTarget, getText, getTitle, removeVetoableChangeListener, setDirection, setLanguage, setLink, setLocation, setName, setProperties, setTarget, setText, setTitle, toString
 
Methods inherited from class com.ibm.as400.util.html.HTMLTagAttributes
getAttributes, getAttributeString, setAttributes
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServletHyperlink

public ServletHyperlink()
Creates a default ServletHyperlink object.


ServletHyperlink

public ServletHyperlink(String link)
Creates a ServletHyperlink object with the specified resource link.

Parameters:
link - The Uniform Resource Identifier (URI).

ServletHyperlink

public ServletHyperlink(String link,
                        String text)
Creates a ServletHyperlink object with the specified resource link represented by the specified text.

Parameters:
link - The Uniform Resource Identifier (URI).
text - The text representation for the resource.

ServletHyperlink

public ServletHyperlink(String link,
                        String text,
                        String target)
Creates a ServletHyperlink object with the specified resource link and target frame represented by the specified text.

Parameters:
link - The Uniform Resource Identifier (URI).
text - The text representation for the resource.
target - The target frame.

ServletHyperlink

public ServletHyperlink(String link,
                        String text,
                        String target,
                        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.

Parameters:
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.
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener. The specified PropertyChangeListener's propertyChange method is called each time the value of any bound property is changed.

Overrides:
addPropertyChangeListener in class HTMLTagAttributes
Parameters:
listener - The PropertyChangeListener.
See Also:
removePropertyChangeListener(java.beans.PropertyChangeListener)

clone

public Object clone()
Returns a copy of the ServletHyperlink.

Overrides:
clone in class HTMLHyperlink
Returns:
An ServletHyperlink.

getHttpServletResponse

public javax.servlet.http.HttpServletResponse getHttpServletResponse()
Returns the Http servlet response.

Returns:
The response.

getPathInfo

public String getPathInfo()
Returns the path information.

Returns:
The path.

getTag

public String getTag()
Returns the HTML tag that represents the resource link.

Specified by:
getTag in interface HTMLTagElement
Overrides:
getTag in class HTMLHyperlink
Returns:
The HTML tag.

getTag

public String getTag(String text,
                     Properties properties)
Returns the HTML tag that represents the resource link with the specified text and properties. The original ServletHyperlink object text and properties are not changed/updated.

Overrides:
getTag in class HTMLHyperlink
Parameters:
text - The text.
properties - The Properties.
Returns:
The HTML tag.

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Removes the PropertyChangeListener from the internal list. If the PropertyChangeListener is not on the list, nothing is done.

Overrides:
removePropertyChangeListener in class HTMLTagAttributes
Parameters:
listener - The PropertyChangeListener.
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener)

setHttpServletResponse

public void setHttpServletResponse(javax.servlet.http.HttpServletResponse response)
Sets the Http servlet response for the resource link.

Parameters:
response - The Http servlet response.

setPathInfo

public void setPathInfo(String path)
Sets the path information for the resource link.

Parameters:
path - The path information.