Forums Register Login

How preserve formatting while getting some text from database

+Pie Number of slices to send: Send
Here is my problem.

I am developing a discussion forum using JSP.
The text data which is being saved in database and then retrieved is losing its original formatting.

What's the trick to preserve the format in the database and in the output.

Thanks in advance.
+Pie Number of slices to send: Send
May be you could have few more fields for the formatting part in the table. This is my thought, there might be better approaches to this too.
1
+Pie Number of slices to send: Send
In an HTML page, whitespace is ignored.

If the formatting you are talking about is carriage returns/spaces then you need to either
- replace carriage returns with
tags etc
- use <pre> tags around the preformatted text

I'm not sure if I approve of this interruption. But this tiny ad checks out:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1016 times.
Similar Threads
How to save a text file content in a database
? Throw an exception vs other approach
parsing plain file into html
Saving and retrieving formatted data from database
How to draw a chart with multiple y-axises
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 20:05:06.