This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

print string with breaks on web page

 
sudheshna Iyer
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a string like "aaa
bbb
ccc". I want to print that as :
aaa
bbb
ccc
on to the web page.
When I use the following code. I see it get printed as "aaa
bbb " and when I view the source,
I see it as "aaa</br>bbb". How can print them with breaks.

Code:
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First: your HTML syntax is invalid. Write valid HTML.
Second: the c:out by default escapes XML/HTML. Leave it away or set its escapeXml attribute to false.
Third: using scriptlets is a bad practice, use taglibs/EL only.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic