Class HtmlEncoder

  • public final class HtmlEncoder
    extends Object
    HTML encoding of special characters to prevent cross site scripting (XSS) attacks. Any data that is "echoed" back from a request can be used to execute a script in a browser unless properly encoded.
    • Method Detail

      • encode

        public static String encode​(String s)
        Encode HTML string replacing the special characters by their corresponding entities.
        s - string to encode.
        encoded string.