This week's book giveaway is in the Agile forum.
We're giving away four copies of Head First Agile and have Andrew Stellman & Jennifer Greene on-line!
See this thread for details.
Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Java version of PHP nl2br() function?  RSS feed

 
Juhan Voolaid
Ranch Hand
Posts: 179
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am wondering if there is a tag, that formats text so, that replaces new-line charaters "/n" with html line break tags "<br/>".

It is needed, when I get text from a database and want to display it on view.

In PHP there is a function for that: nl2br()
[ May 01, 2006: Message edited by: Nathan Pruett ]
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not aware of anything in JSTL that does this. You'd have to either use a scriptlet or make a custom tag of your own that performs this function.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!