wood burning stoves 2.0*
The moose likes JSP and the fly likes print string with breaks on web page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "print string with breaks on web page" Watch "print string with breaks on web page" New topic

print string with breaks on web page

sudheshna Iyer
Ranch Hand

Joined: Aug 20, 2004
Posts: 71
I have a string like "aaa
ccc". I want to print that as :
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.

Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
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.
I agree. Here's the link: http://aspose.com/file-tools
subject: print string with breaks on web page
Similar Threads
pagination for forEach of JSTL List
mysql & incomplete insertions!
need help on passing string
Table nested inside a div