org.springframework.web.servlet.tags

Class HtmlEscapingAwareTag

    • Constructor Detail

      • HtmlEscapingAwareTag

        public HtmlEscapingAwareTag()
    • Method Detail

      • isHtmlEscape

        protected boolean isHtmlEscape()
        Return the HTML escaping setting for this tag, or the default setting if not overridden.
        See Also:
        isDefaultHtmlEscape()
      • isDefaultHtmlEscape

        protected boolean isDefaultHtmlEscape()
        Return the applicable default HTML escape setting for this tag.

        The default implementation checks the RequestContext's setting, falling back to false in case of no explicit default given.

        See Also:
        RequestContextAwareTag.getRequestContext()
      • isResponseEncodedHtmlEscape

        protected boolean isResponseEncodedHtmlEscape()
        Return the applicable default for the use of response encoding with HTML escaping for this tag.

        The default implementation checks the RequestContext's setting, falling back to false in case of no explicit default given.

        Since:
        4.1.2
        See Also:
        RequestContextAwareTag.getRequestContext()
      • htmlEscape

        protected java.lang.String htmlEscape(java.lang.String content)
        HTML-encodes the given String, only if the "htmlEscape" setting is enabled.

        The response encoding will be taken into account if the "responseEncodedHtmlEscape" setting is enabled as well.

        Parameters:
        content - the String to escape
        Returns:
        the escaped String
        Since:
        4.1.2
        See Also:
        isHtmlEscape(), isResponseEncodedHtmlEscape()