org.apache.sling.scripting.jsp.taglib.helpers

## Class XSSSupport

- java.lang.Object
- - org.apache.sling.scripting.jsp.taglib.helpers.XSSSupport

    public class XSSSupport
    extends Object

Support for basic XSS protection as provided by the OWASP ESAPI's escape methods.

### Nested Class Summary

Nested Classes
`static class` `XSSSupport.ENCODING_MODE` The encoding modes supported by this tag.

### Constructor Summary

Constructors
Constructor and Description
`XSSSupport()`

### Method Summary

All Methods Static Methods Concrete Methods
`static String` `encode(String unencoded, XSSSupport.ENCODING_MODE mode)` Encodes the unencoded string using the specified mode.
`static XSSSupport.ENCODING_MODE` `getEncodingMode(String modeStr)` Retrieves the encoding mode associated with the specified string.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### XSSSupport

    public XSSSupport()

### Method Detail

#### encode

    public static String encode(String unencoded,
                                XSSSupport.ENCODING_MODE mode)

Encodes the unencoded string using the specified mode. This will be deferred to the corresponding OWASP ESAPI encoding method.

Parameters:
  `unencoded` - the unencoded string
  `mode` - the mode with which to encode the string
Returns:
  the encoded string

#### getEncodingMode

    public static XSSSupport.ENCODING_MODE getEncodingMode(String modeStr)

Retrieves the encoding mode associated with the specified string. Will throw an IllegalArgumentException if the mode string is not a valid mode and will throw a NullPointerException if the mode string is null.

Parameters:
  `modeStr` - the mode string
Returns:
  the encoding mode