aspose file tools*
The moose likes Java in General and the fly likes formatting text output from database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "formatting text output from database" Watch "formatting text output from database" New topic
Author

formatting text output from database

tom mcmorrow
Ranch Hand

Joined: Jan 11, 2002
Posts: 39
hi all
not sure if this is the right place to ask this question but it seems as good as any other.
I am trying to fromatt text output to html from a mysql data base - the input was with a textarea - would like to maintain the same fromat as the imputted text however not working for me. Anyone know where i could get some information on approaches to this problem
thnking you for you help
tom mcmorrow
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
How does the mysql database retain the formatting?


"JavaRanch, where the deer and the Certified play" - David O'Meara
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
My guess is that you are not specifying the textarea quite right. By default, a textarea ignores end-of-lines. Try adding "wrap='hard'" to yor textarea tag.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
tom mcmorrow
Ranch Hand

Joined: Jan 11, 2002
Posts: 39
hi
thanks for your swift replies Cindy and Frank
i don't know much about this particular subject and was hoping maybe someone could point me in the direction of some material on it. My experience of working with databases is very limited.
tom
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
So I am back to my question.
Did you save the text in the TextArea or the object which is a TextArea or what?
Or are you really just worried about end-of lines ?
[ August 23, 2002: Message edited by: Cindy Glass ]
tom mcmorrow
Ranch Hand

Joined: Jan 11, 2002
Posts: 39
thanks again cindy for you patient interest
My text is inputted to a textArea it is then submitted as part of a form to a servlet which saves the imput to a mysql database. The data is again retrieved on demand from the database by an servlet and outputted to a html page. I would like to maintain the output in the same format as
the text was imputted.
tom
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
You need to explain what you mean by "in the same format". When text is input into a TextArea it is usually represented on the screen by some LayoutManager. Change the window size - the "format" changes to accomodate that.
What formatting is NOT being saved?
Do you really mean that you just want to insure that any New Line or Carriage Returns are preserved, like Frank thought?
Are you trying to retain the FONT of the input?
Is this really a JAVA or JSP TextArea, or are you talking about an HTML (JavaScript) TextArea?
[ August 23, 2002: Message edited by: Cindy Glass ]
tom mcmorrow
Ranch Hand

Joined: Jan 11, 2002
Posts: 39
primarly i am trying to retain the tab spaces at the beginning of the lines. Hence the first word stands out as it is not indented the other lines are. i have used a JText area for input. Franks idea works in part for me i will try a little more experiment on it and come back in a while
tom
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: formatting text output from database
 
Similar Threads
xsl
HTML GUI for java
Display UNIX Commands in TextArea
Thread's question..
parsing doubt