How do I get \r and \n from Java string to be displayed in text area of JSP
843835Apr 3 2002 — edited Dec 4 2003I use a Prepared Statement insert to add data that is inputed by a user on my JSP to a mysql database. That works fine. I am able to add special characters including \n, \r, and single and double quotes.
My problem is when I try to retrieve the string values from the database (that have new line and carriage return characters within them) and try to load them into textareas in my JSP.
After first experiencing this problem I was told that I need to pretty much filter each string I want to display on my JSP where I would replace any instance of a \n or \r with a <br> tag. I have done this, AND STILL I DO NOT GET THE STRING TO DISPLAY IN MY TEXT AREA????
Please help if you can...quite URGENT!!!