srivenky
asked on
How to display <br> from a string to html
I have bean class
public class X ......{
String htmlString;
public void getHtmlString()
{
return htmlString;
}
public void setHtmlString()
{
String htmlString_="Hello<br>Hell o";
this.htmlString = htmlString_;
}
From the Jsp page I use
<bean:write name="X" property="htmlString"/>
The output of the jsp displays Hello <br> Hello.
Instead i need a output like
Hello
Hello
If i use <%= <brString> %> it works fine. It display
Hello
Hello
Instead if i use <bean:write> then it does not display in next line.
public class X ......{
String htmlString;
public void getHtmlString()
{
return htmlString;
}
public void setHtmlString()
{
String htmlString_="Hello<br>Hell
this.htmlString = htmlString_;
}
From the Jsp page I use
<bean:write name="X" property="htmlString"/>
The output of the jsp displays Hello <br> Hello.
Instead i need a output like
Hello
Hello
If i use <%= <brString> %> it works fine. It display
Hello
Hello
Instead if i use <bean:write> then it does not display in next line.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Try adding filter="false" to turn off escaping.
<bean:write name="X" property="htmlString" filter="false"/>