I have a JSP page with some text boxes. The user fills out the form, clicks the Apply button, the inputs get saved to an Oracle 10.g database. The form can be viewed again and the text boxes are populated with the saved data so the entries can be edited and re-saved.
When reading in from an inputText text box on my JSP page, Oracle stores the < character as <
This means that when the text is retrieved from the database and printed as the value in a JSP inputText box, it is rendered as < instead of <.
The same thing happens with > which gets stored as > but only if one or more < characters are included in the same input text box, otherwise it gets stored in oracle as > and there is no problem retrieving it. No other characters like & or the copyright symbol get converted to their HTML entities, it is just < and >.
Is there a way to stop < and > being converted to their HTML entities when they are saved to the database? When retrieving and displaying, writing a function to examine a string and replace any instances of < with < is not an option because if the string "<" is entered by the user in the text box, I'll want < to be displayed, not <.
Thanks!