Class IncludeUrlTag

  • All Implemented Interfaces:
    javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.SimpleTag

    public class IncludeUrlTag
    extends javax.servlet.jsp.tagext.SimpleTagSupport
    Implements the wm:includeUrl tag. This tag evaluates the URL to which the given parameter points and writes the result to the jsp page. External URLs should start with 'http'. Internal URLs should be relative to the context path (i.e. start with /).
    (Note: use this instead of jsp:include to pass on the presentationcontext!)
    Example of usage:
     < wm:includeUrl url="/WEB-INF/presentation/jsp/shared/include/top.jspf" />
     
    In the example above the content of top.jspf is included at the position of the < wm:includeUrl > tag.
    • Constructor Summary

      Constructors 
      Constructor Description
      IncludeUrlTag()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void doTag()  
      protected int getConnectionTimeout()
      Return the connection timeout for external URLs (value in milliseconds).
      protected int getReadTimeout()
      Return the read timeout for external URLs (value in milliseconds).
      protected String getUrl()
      Return the URL indicating the resource to retrieve HTML from
      protected boolean isFollowRedirects()
      Return whether a redirect should be followed if the URL returns a redirect to another location.
      void setConnectionTimeout​(int connectionTimeout)
      Sets the connection timeout for external URLs.
      void setFollowRedirects​(boolean followRedirects)
      Specifies whether a redirect should be followed if the URL returns a redirect to another location.
      void setReadTimeout​(int readTimeout)
      Sets the read timeout for external URLs.
      void setUrl​(String url)
      Specifies the URL indicating the resource to retrieve HTML from.
      • Methods inherited from class javax.servlet.jsp.tagext.SimpleTagSupport

        findAncestorWithClass, getJspBody, getJspContext, getParent, setJspBody, setJspContext, setParent
    • Constructor Detail

      • IncludeUrlTag

        public IncludeUrlTag()
    • Method Detail

      • setUrl

        public void setUrl​(String url)
        Specifies the URL indicating the resource to retrieve HTML from. To include references to other JSP files, use the relative path found on the �Presentation� tab in GX WebManager.
        Parameters:
        url - the URL indicating the resource to retrieve HTML from
      • getUrl

        protected String getUrl()
        Return the URL indicating the resource to retrieve HTML from
        Returns:
        the URL indicating the resource to retrieve HTML from
      • setConnectionTimeout

        public void setConnectionTimeout​(int connectionTimeout)
        Sets the connection timeout for external URLs. Input in milliseconds. Default value is 5000 (= 5 sec.).
        Parameters:
        connectionTimeout - timeout in milliseconds.
      • getConnectionTimeout

        protected int getConnectionTimeout()
        Return the connection timeout for external URLs (value in milliseconds).
        Returns:
        connection timeout in milliseconds.
      • setReadTimeout

        public void setReadTimeout​(int readTimeout)
        Sets the read timeout for external URLs. Input in milliseconds. Default value is 10000 (= 10 sec.).
        Parameters:
        readTimeout - timeout in milliseconds
      • getReadTimeout

        protected int getReadTimeout()
        Return the read timeout for external URLs (value in milliseconds).
        Returns:
        read timeout in milliseconds.
      • setFollowRedirects

        public void setFollowRedirects​(boolean followRedirects)
        Specifies whether a redirect should be followed if the URL returns a redirect to another location. Default value is �true� (= follow the redirect).
        Parameters:
        followRedirects -
      • isFollowRedirects

        protected boolean isFollowRedirects()
        Return whether a redirect should be followed if the URL returns a redirect to another location. Default value is �true� (= follow the redirect).
        Returns:
        true if redirects are followed when including external urls
      • doTag

        public void doTag()
                   throws javax.servlet.jsp.JspException,
                          MalformedURLException
        Specified by:
        doTag in interface javax.servlet.jsp.tagext.SimpleTag
        Overrides:
        doTag in class javax.servlet.jsp.tagext.SimpleTagSupport
        Throws:
        javax.servlet.jsp.JspException
        MalformedURLException