Class StripInvalidXmlCharactersFilter

All Implemented Interfaces:

public class StripInvalidXmlCharactersFilter extends Object implements Filter

Strips all invalid XML characters on incoming parameters. GET requests on the DispatcherType.REQUEST dispatcher will be 301-redirected to the same URL without the invalid XML characters. All other methods and all other dispatchers, including POST requests, will have the invalid XML characters stripped.

Parameters with invalid names are removed.

This implementation supports UTF-16 surrogate pairs:

The allowed characters defined by the specification at

Char   ::=   #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]

Only HTTP/HTTPS requests are filtered.

This should be used for both the DispatcherType.REQUEST and DispatcherType.ERROR dispatchers.