The following piece of code in my JSP caused a cross site scripting vulnerability on the input tag.
<td id="locale-block" align="left" style="visibility: hidden; height: 0;">
<input type="text" id="locale" name="locale" text="eng" value = "eng">eng
</td>
During Penetration testing they were able to alert some random message to the user by injecting a alert script in the value attribute of the tag as follows
</script><script>alert(1);</script><script>
What should be done to avoid this? Is there any simple solution which does not involve paid 3rd party paid library?