fatherModule.setModuelName(HtmlUtils.htmlEscape(fatherModule.getModuelName())); log.info(HtmlUtils.htmlEscape(fatherModule.getModuelName())); log.info(fatherModule); String s = HtmlUtils.htmlEscape("<div>hello world</div><p> </p>"); log.info(s); String s2 = HtmlUtils.htmlUnescape(s); log.info(s2); adminIndexService.saveFatherModule(fatherModule); return "redirect:"+ActionURL.ADMIN_INDEX;
运行结果
2016-01-30 23:02:33 86 INFO AdminIndexAction - &lt;span style=&quot;color:red&quot;&gt;123sadfa&lt;/span&gt; 2016-01-30 23:02:33 87 INFO AdminIndexAction - FatherModule [id=null, moduelName=<span style="color:red">123sadfa</span>, sort=0] 2016-01-30 23:02:33 89 INFO AdminIndexAction - <div>hello world</div><p>&nbsp;</p> 2016-01-30 23:02:33 91 INFO AdminIndexAction - <div>hello world</div><p> </p>
这个还需优化,这个应该只在哪些具有输入的地方进行过滤,这个怎么实现呢?