In my Java web app I pull a property from the database and send it to the view/browser layer via the controller.
In the HTML, I am expecting the string to look like this:
9" nails
Instead it looks like this:
"9\" nails"
So I plugged Apache StringEscapeUtils
into my service layer and ran unescapeJava()
on the property. The result became this:
"9" nails"
A slight improvement but still not right.
So my question is whether this is not just a String escaping issue but a more fundamental data issue. In other words, if what I have to do to achieve the desired output is to strip double quotes from the beginning and end of this property, there is a potential to affect other rows of data in unexpected ways - in which case I would have to visually inspect the entire database to make sure I am not displaying some other rows incorrectly based on the meaning of the double quotes character in those other strings.
Any direction here would be appreciated. Thanks.