net.sf.json.util
Class WebHijackPreventionStrategy
java.lang.Object
net.sf.json.util.WebHijackPreventionStrategy
public abstract class WebHijackPreventionStrategy
- extends Object
Defines base implementations for preventing WebHijack in AJAX applications.
The default implementations are:
- COMMENTS - wraps the string with /* *\/
- INFINITE_LOOP - prepends "while(1);"
- Author:
- Andres Almiray
Method Summary |
abstract String |
protect(String str)
Transforms the input with the desired strategy.
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
COMMENTS
public static final WebHijackPreventionStrategy COMMENTS
- Wraps the string with /* *\/
INFINITE_LOOP
public static final WebHijackPreventionStrategy INFINITE_LOOP
- Prepends "while(1);"
WebHijackPreventionStrategy
public WebHijackPreventionStrategy()
protect
public abstract String protect(String str)
- Transforms the input with the desired strategy.
- Parameters:
str
- a json string
- Returns:
- String - the transformed json string