I am using Struts 2 and I have a label tag in my JSP that has label and name attribute in it, like below
<s:label label="Name" name="editNom.name" />
Name attribute contains value Maz's Organisation
(from variable editNom.name
) that should be displayed as Maz's Organisation
. This value displays fine when I use ${editNom.name}
directly in JSP with UTF-8 encoding. However, in the same JSP, when I use the above struts tag, it displays as Maz's Organisation
.
Can some one suggest how do I apply UTF-8 character encoding to struts tags?
EDIT - 10/02/2017:
I found the root cause. On inspecting my webpage in chrome, I find that the value when using the variable directly in JSP is
Maz's Organisation
where as when I use it in struts tag, it escapes the &
to &
thus the value becomes
Maz&apos;s Organisation
If I can stop struts from escaping &
, I guess this issue can be resolved. Not sure how to do that. Can some one help me in this?