hi all, i have a prob with bean:write. the prob is i am inserting value into database after taking value from one textarea. and then displaying that entered value into some other page using bean:write. but the prob is when we enter the value and suppose we press enter key few time i.e. break down the text into different paragraphs. i am able to insert into database as it is. but when i am trying to display those paragraphs using bean:write then it is omitting the line breaks. all the text is being displayed continuously instead of being displayed paragraph wise. can some one help. Thanks a lot in advance. Amit
****************************<br />In 24 hrs Earth rotates once on its Axis.
This is likely because a) HTML treats more than one whitespace character (tab, space, CRLF, etc) as a single whitespace. b) CRLF is not honored in HTML. So you have a couple options. 1) When you get the data back from your database, you can replace all CRLF (aka \n or \r) characters with <br> 2) Put <pre> </pre> tags around the bean:write 3) Display all the text in a text box as it was entered (note that you can make this non-editable).
"Write beautiful code; then profile that beautiful code and make little bits of it uglier but faster." --The JavaPerformanceTuning.com team, Newsletter 039.
Joined: Oct 10, 2003
Hi david, thanx a lot man... it really helped me a lot.. i couldn't used the changing of CLRF to <br> and also display the data in text box and make it non-editable due to some project constrants. but the <pre></pre> tag helped me a lot. but now the prob is that the tag is not wrapping the text which i need to do. if the text is too long then i need it to be displayed after wrapping. but right now it is getting away from the browser's view and we have to scroll the text. this text is in a table so the row is also getting widened. is there any solution to this???
thanx a lot man. Amit [ March 25, 2004: Message edited by: Amit KumarS ]
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com