File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Description entered in the form (textarea) gets wrapped

 
sachin pachpute
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my spring, JSP based application, user is entering free from description in the text area. But when data is saved and displayed on the next (read only) page, entire text is wrapped in to single para. I want whole text to be saved as user enters it along with line spaces, newlines, tabs etc.

eg is as below.

below entered description when saved will get wrapped in to a single para and will not be dispayed as it looks below.I have posted this question on other forums and also tried finding solution online so please help.


Books in the stack are

Spring
Hibernate
jQuery
mySQL
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Either use a pre tag

Or you need to convert the new lines and extra spaces to <br/> and &nbsp;
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic