sridhar
sridhar

Reputation: 1157

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?

Upvotes: 0

Views: 3096

Answers (2)

dvlpr
dvlpr

Reputation: 139

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.

Upvotes: 1

Yashpal Singla
Yashpal Singla

Reputation: 1994

One solution is, create a custom method, and replace all string occurrences of &gt with > and do similar operation for other html characters.

Upvotes: 0

Related Questions