Safe html in java
问题 I have some input containing HTML like <br> <b> <i> etc. I need a way to escape only the "bad" HTML that exposes my site to XSS etc. After hours of Googeling I found the GWT which looks kinda promising. What is the recommended way to escape bad HTML ? Edit: Let me clear things up. I am using a javascript text editor which outputs html. Wouldn't it be much easier if i use something like bbcode? 回答1: Google caja is a tool for making third party HTML, CSS and JavaScript safe to embed in your