Hi,
I need to store the text entered in a TEXTAREA control in the database, and retrieve when ever required.
Here the problem is It is not storing the new line characters (enter key), it is storing all the lines as ONE sentence.
I tried using different values for wrap attribute.(soft, hard, physical,virtual, etc), but no use.
For HML, a newline character is just whitespace, and will be displayed as a space character. If you want an actual line break to appear on the HTML page,. you'll need to convert all newline characters to "<br/>" before displaying them.
At which point along the code are the newline characters dropped? Are they still present when the servlet receives the form? Are they present in the DB? Are they present when the data is retrieved from the DB? Are they present when the JSP with the TEXTAREA is created?
At which point along the code are the newline characters dropped?
While storing into the table.
I am retrieving the form data in a servlet using request.getParamter(); if I print the content of the TEXTAREA character by character as int by casting , it is showing new line as 13 & 10 (two characters). After this I am storing this value in a TABLE, in the table it is storing as one string instead multiple lines (means no special characters are stored at the new line character positions)
Then you should dig into the DB connectivity to see why it's dropping those characters. SQL and JDBC don't arbitrarily alter data they're handling, so some other piece of code may be involved.
moose poop looks like football shaped elk poop. About the size of this tiny ad:
Gift giving made easy with the permaculture playing cards