Priya,
Can you show the code you are using to create the textbox with the new lines? I think it is a vs \n thing, but it's hard to tell without seeing the code.
Hi Priya, you can do it this way. Consider a sample code and the string you are retrieving from database is in first column:
Actually I executed this code. It is working. I am getting a new line every time. If this doesn't work try with the first one.
I created a table named abc which contains abcd\nefgh\nijkl and I tried to retrieve it. It came as I expected. The sentance was splitted into three different lines.
You can use any of the methods. I think there is a mistake in <textarea> tag. Once check it. I think the first one is a bad practice. You better check your tag and follow the third one.
Have a nice day.
Love all, trust a few, do wrong to none.
yuvaraj KumarAmudhan
Ranch Hand
Joined: Aug 22, 2009
Posts: 110
posted
0
priya!
html page does not know about "\n" character of java.
"\n" in java = <br> of html. try <br> tag. you will get what you need!
Hi Priya, it is not possible to give suggestions further until you paste a sample code. Please paste your code.
Sunder Ganapathy
Ranch Hand
Joined: Apr 01, 2003
Posts: 120
posted
0
1. Using textarea does not give line-break , which you may try with a simple HTML and see.
2. Using \n also does not give line-break.
3. You need to use tag for this purpose.
4. Using table option does provide the line-break.
5. The column value used, for the database is, 'I am here \n You are there \n I am not going any where. '
6. The jsp code is as follows.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.