Class CanonicalLinkTag

java.lang.Object
jakarta.servlet.jsp.tagext.TagSupport
org.deltava.taglib.content.CanonicalLinkTag
All Implemented Interfaces:
jakarta.servlet.jsp.tagext.IterationTag, jakarta.servlet.jsp.tagext.JspTag, jakarta.servlet.jsp.tagext.Tag, Serializable

public class CanonicalLinkTag extends jakarta.servlet.jsp.tagext.TagSupport
A JSP tag to generate canonical URLs for a page.
Since:
6.0
Version:
8.2
Author:
Luke
See Also:
  • Field Summary

    Fields inherited from class jakarta.servlet.jsp.tagext.TagSupport

    id, pageContext

    Fields inherited from interface jakarta.servlet.jsp.tagext.IterationTag

    EVAL_BODY_AGAIN

    Fields inherited from interface jakarta.servlet.jsp.tagext.Tag

    EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Writes the canonical link tag to the JSP output stream.
    int
    Checks the input parameters and calculates the canonical URL if necessary.
    void
    Releases the tag's state variables.
    void
    setConvertID(boolean convertID)
    Sets whether to convert numeric ID parameters to hexadecimal.
    void
    Overrides the canonical URL for this page.

    Methods inherited from class jakarta.servlet.jsp.tagext.TagSupport

    doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue

    Methods inherited from class Object

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

    • CanonicalLinkTag

      public CanonicalLinkTag()
  • Method Details

    • setUrl

      public void setUrl(String url)
      Overrides the canonical URL for this page.
      Parameters:
      url - the URL
    • setConvertID

      public void setConvertID(boolean convertID)
      Sets whether to convert numeric ID parameters to hexadecimal.
      Parameters:
      convertID - TRUE if parameters should be converted, otherwise FALSE
    • release

      public void release()
      Releases the tag's state variables.
      Specified by:
      release in interface jakarta.servlet.jsp.tagext.Tag
      Overrides:
      release in class jakarta.servlet.jsp.tagext.TagSupport
    • doStartTag

      public int doStartTag() throws jakarta.servlet.jsp.JspException
      Checks the input parameters and calculates the canonical URL if necessary.
      Specified by:
      doStartTag in interface jakarta.servlet.jsp.tagext.Tag
      Overrides:
      doStartTag in class jakarta.servlet.jsp.tagext.TagSupport
      Returns:
      SKIP_BODY always
      Throws:
      jakarta.servlet.jsp.JspException - if an error occurs
    • doEndTag

      public int doEndTag() throws jakarta.servlet.jsp.JspException
      Writes the canonical link tag to the JSP output stream.
      Specified by:
      doEndTag in interface jakarta.servlet.jsp.tagext.Tag
      Overrides:
      doEndTag in class jakarta.servlet.jsp.tagext.TagSupport
      Returns:
      EVAL_BODY always
      Throws:
      jakarta.servlet.jsp.JspException - if an error occurs