This discussion is archived
0 Replies Latest reply: Oct 21, 2010 10:48 PM by 807034 RSS

Struts2 - Escape form values while submitting

807034 Newbie
Currently Being Moderated

I am using struts2 and annotations for validations.

In my form, when i put following text in any textbox and say validation gets failed then same form display again but the textbox (Where I entered following text) shows wrongly, i mean text box shown with prefilled text "cross script <input type=" and other text (Airplane" type="text" class="txtbox" id="" maxlength="255" />) next to textbox.

"cross script <input type="radio" name="vehicle1" value="Airplane"> Airplane"

Any inbuilt way in struts2 to escape special characters and quotes so that it should not disturbed the form and its values in case of server side error in saving the data in DB?

Krishan Babbar


  • Correct Answers - 10 points
  • Helpful Answers - 5 points