This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes writing out line brakes when using string 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 » Frameworks » Struts
Bookmark "writing out line brakes when using string" Watch "writing out line brakes when using string" New topic
Author

writing out line brakes when using string

Theo van Loon
Ranch Hand

Joined: Feb 04, 2004
Posts: 71
Hello all,

i have a class that holds a description field which is a string. I would like to know if it's possible to give line brakes in this desciption.

in html it would look like this :

desciption first part
<br />
desciption second part

The String is just printed out to the screen like this

desciption first part <br /> desciption second part

So there is no linebrake and the user sees the <br/> element printed out to the screen.

I also tried the '/n' new line in the String field, this also doesn't work.

So the question is, how can i print out a string and give the String elements in order to know where to put linebrakes.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The trick is to specify filter="false" within the <bean:write> tag. This will tell struts that you know what you're doing and can be trusted to put html tags in the contents of your <bean:write> tags that will not completely foul up the page.

Merrill


Merrill
Consultant, Sima Solutions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: writing out line brakes when using string
 
Similar Threads
while-loop
Mock Exam question
what exactly is happening?
Dropdown list
Reflection in Java