File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
How preserve formatting while getting some text from database
Shruti Sagar Mohanta
Joined: Nov 22, 2012
Nov 22, 2012 05:01:14
Here is my problem.
I am developing a discussion forum using
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.
Joined: Jan 08, 2009
Nov 22, 2012 05:14:00
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.
Joined: Jul 06, 2005
Nov 22, 2012 13:15:17
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
- use <pre> tags around the preformatted text
I agree. Here's the link:
subject: How preserve formatting while getting some text from database
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
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014