Package org.atmosphere.util
Class XSSHtmlFilter
java.lang.Object
org.atmosphere.util.XSSHtmlFilter
- All Implemented Interfaces:
BroadcastFilter
Simple
BroadcastFilter which automatically filter
HTML/HTTP character into proper value, like \n replace by <br>. Using
this BroadcastFilter prevent XSS attack.- Author:
- Jeanfrancois Arcand
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.atmosphere.cpr.BroadcastFilter
BroadcastFilter.BroadcastAction -
Field Summary
Fields inherited from interface org.atmosphere.cpr.BroadcastFilter
VOID_ATMOSPHERE_RESOURCE_UUID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionTransform a message into a well formed HTML message.
-
Constructor Details
-
XSSHtmlFilter
public XSSHtmlFilter()
-
-
Method Details
-
filter
public BroadcastFilter.BroadcastAction filter(String broadcasterId, Object originalMessage, Object o) Transform a message into a well formed HTML message.- Specified by:
filterin interfaceBroadcastFilter- Parameters:
broadcasterId- theBroadcaster.getID()calling this objectoriginalMessage- The original message which wasBroadcaster.broadcast(Object);o- The object to introspect.- Returns:
- a well formed
-