简体   繁体   中英

How can I unescape HTML escape character from JSP to Java

I am applying fn:escapeXml to a input value (say > ) in JSP to do html escape. When I submit the form, I do need to send the parameter to the controller. In my controller, the request parameter comes as &gt and not > . Because of this, I could not unescape in the controller to get the original value. Could anyone help on this?

Apache Commons Lang - String Escape Utils

http://commons.apache.org/lang/api-2.4/org/apache/commons/lang/StringEscapeUtils.html

Use one of the unescape methods.

一种解决方案是,创建一个自定义方法,并用>替换所有出现的&gt字符串,并对其他html字符执行类似的操作。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM