|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.response.filter.XmlCleaningResponseFilter
public class XmlCleaningResponseFilter
An IResponseFilter that removes all invalid XML characters. By default it is used only for Wicket Ajax responses.
If the application needs to use it for other use cases then it can either override shouldFilter(AppendingStringBuffer) in the case it is used as IResponseFilter or stripNonValidXMLCharacters(AppendingStringBuffer) can be used directly.
Usage:
MyApplication.java
public void init() {
super.init();
getRequestCycleSettings().addResponseFilter(new XmlCleaningResponseFilter());
}
Constructor Summary | |
---|---|
XmlCleaningResponseFilter()
|
Method Summary | |
---|---|
AppendingStringBuffer |
filter(AppendingStringBuffer responseBuffer)
Filters the response buffer and returns the filtered response that can be used in the next filter or returned to the real output itself. |
protected boolean |
isValidXmlChar(int codePoint)
Checks whether the character represented by this codePoint is a valid in XML documents. |
protected boolean |
shouldFilter(AppendingStringBuffer responseBuffer)
Decides whether the filter should be applied. |
AppendingStringBuffer |
stripNonValidXMLCharacters(AppendingStringBuffer input)
This method ensures that the output String has only valid XML unicode characters as specified by the XML 1.0 standard. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlCleaningResponseFilter()
Method Detail |
---|
public AppendingStringBuffer filter(AppendingStringBuffer responseBuffer)
IResponseFilter
filter
in interface IResponseFilter
responseBuffer
- The response buffer to be filtered
protected boolean shouldFilter(AppendingStringBuffer responseBuffer)
responseBuffer
- The buffer to filter
true
if the buffer brings Ajax responsepublic AppendingStringBuffer stripNonValidXMLCharacters(AppendingStringBuffer input)
input
- The StringBuffer whose non-valid characters we want to remove.
protected boolean isValidXmlChar(int codePoint)
codePoint
- The codePoint for the checked character
true
if the character can be used in XML documents
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |