Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How do I get \r and \n from Java string to be displayed in text area of JSP

843835Apr 3 2002 — edited Dec 4 2003
I 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!!!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 1 2004
Added on Apr 3 2002
22 comments
1,037 views