title: Struts 2 - is there any way to escape HTML in input fields?
body: <p>When I allow a user to enter text using <code>s:textfield</code>, he can enter something like <code>&lt;b&gt;Name&lt;/b&gt;</code> or something like <code>\Me/</code>. I want that these should be escaped before I am saving them to the database. When we retrieve them, the escaping is done automatically, but I want it to happen also when we are saving it. </p>
  
  <p>I was trying to return a <code>json</code> output from my action class, but due to a name <code>\a/</code> stored in my database, wrong json was being formed. This would have been avoided if the name had been escaped before being saved into the database.</p>