com.ibm.as400.util.html

Class URLParser

  • java.lang.Object
    • com.ibm.as400.util.html.URLParser


  • public class URLParser
    extends java.lang.Object
    The URLParser class parses a URL string for the URI, properties, and reference (also known as the "anchor"). The reference is indicated by the sharp sign character "#" followed by more characters. For example,
      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 Summary

      Constructors 
      Constructor and Description
      URLParser(java.lang.String url)
      Constructs a URLParser object with the specified url.
    • Method Summary

      Methods 
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • URLParser

        public URLParser(java.lang.String url)
        Constructs a URLParser object with the specified url.
        Parameters:
        url - The url to parse.
    • Method Detail

      • getURL

        public java.lang.String getURL()
        Returns the URL.
        Returns:
        The URL.
      • getURI

        public java.lang.String getURI()
        Returns the URI.
        Returns:
        The URI.
      • getURI

        public static java.lang.String getURI(javax.servlet.http.HttpServletRequest request)
        Returns the URI from the specified request.
        Parameters:
        request - The HttpServletRequest.
        Returns:
        The URI.
      • getReference

        public java.lang.String getReference()
        Returns the reference, also known as the "anchor".
        Returns:
        The reference.
      • getParameters

        public java.util.Properties getParameters()
        Returns the parameters.
        Returns:
        The parameters.
      • getHTMLHyperlink

        public HTMLHyperlink getHTMLHyperlink(java.lang.String text)
        Returns the HTMLHyperlink.
        Parameters:
        text -
        Returns:
        The HTMLHyperlink.
      • getServletHyperlink

        public ServletHyperlink getServletHyperlink(java.lang.String text)
        Returns the ServletHyperlink.
        Parameters:
        text -
        Returns:
        The ServletHyperlink.