com.ibm.as400.util.servlet

Class ServletHyperlink

  • All Implemented Interfaces:
    HTMLConstants, HTMLTagElement, java.io.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:

    • PropertyChangeEvent
    See Also:
    Serialized Form
    • Constructor Detail

      • ServletHyperlink

        public ServletHyperlink()
        Creates a default ServletHyperlink object.
      • ServletHyperlink

        public ServletHyperlink(java.lang.String link)
        Creates a ServletHyperlink object with the specified resource link.
        Parameters:
        link - The Uniform Resource Identifier (URI).
      • ServletHyperlink

        public ServletHyperlink(java.lang.String link,
                        java.lang.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(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.
        Parameters:
        link - The Uniform Resource Identifier (URI).
        text - The text representation for the resource.
        target - The target frame.
      • ServletHyperlink

        public 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.
        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

      • clone

        public java.lang.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 java.lang.String getPathInfo()
        Returns the path information.
        Returns:
        The path.
      • getTag

        public java.lang.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 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. 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.
      • 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(java.lang.String path)
        Sets the path information for the resource link.
        Parameters:
        path - The path information.