A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
EJB 3 in Action
this week in the
EJB and other Java EE Technologies
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
subject: How preserve formatting while getting some text from database
Saving and retrieving formatted data from database
? Throw an exception vs other approach
How to save a text file content in a database
parsing plain file into html
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