Displaying text in JSP
Hi,
I noticed a problem in displaying stored text. I am using <textarea> to get the text, and store it in a MySQL db as a Blob.
When I try to display as a <textarea>, using getString() it works fine!
But, I don't like the look as it is readonly information.
If I use just a <%= getString() %>, then I get all the information, BUT it ignores all the CR/line feeds...
Any suggestions on how to fix this?
Thanks,
Anil
Thanks for that quick response, gimbal2...
Your solution #3 works fine, but I don't like the look. Besides I want to display all the information completely, not with a scroll bar...
I can't use the #1 solution, as I will need to figure out the end of line.....
I am not sure about the #2 <pre>... Can you show me line on how to use it?
By the way, WHAT HAPPENED TO FORMATING HERE? This is exactly my problem, except I don't see the
in my display...
By default, HTML ignores all white space, turning it into a single space.
A <pre> tag overrides that, so that it will print all of your spaces/carriage returns in a <pre> tag through to the browser.
ie - you're telling the browser 'Don't muck with my formatting - this is how I want it'.
<pre><%= displayTheInfo() %></pre>
And it seems that they are 'upgrading' the forums again. Any time they try this it breaks. I'm not sure WTF is happening right now, but I'm not gonna be answering many questions if I can't read them ;-)