org.atmosphere.util
Class XSSHtmlFilter

java.lang.Object
  extended by org.atmosphere.util.XSSHtmlFilter
All Implemented Interfaces:
BroadcastFilter

public class XSSHtmlFilter
extends Object
implements 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
XSSHtmlFilter()
           
 
Method Summary
 BroadcastFilter.BroadcastAction filter(Object originalMessage, Object o)
          Transform a message into a well formed HTML message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XSSHtmlFilter

public XSSHtmlFilter()
Method Detail

filter

public BroadcastFilter.BroadcastAction filter(Object originalMessage,
                                              Object o)
Transform a message into a well formed HTML message.

Specified by:
filter in interface BroadcastFilter
Parameters:
o - The object to introspect.
originalMessage - The original message which was Broadcaster.broadcast(Object);
Returns:
a well formed


Copyright © 2014. All Rights Reserved.