In the last year i used ESAPI project to sanitize and bring the html to common form, today i saw that my mainly heavy "traffic" is mainly because of the only line that i use from ESAPI:
ESAPI.encoder().canonicalize(string);
I read about OWASP new project "Java Encoder" which is a lightweight of the whole ESAPI to whom want to use only the encoder(and i do). The only thing i'm not quite understood, is how to replace the one line with the new Encoder?(hence, it doesn't have encoder() and canonicalize() functions). The only way i found is to parse it through is:
Encode.forHtml();
Encode.forCssString()
and so on. Is there another way? or maybe i even didn't understood right the documentation.