Write a java bean that would replace each occurrence of \n with <br/>
public String getDescription() {
String description = (String)JSFUtils.resolveExpression("#{row.Description}");
if (description != null)
description = description.replaceAll("\n", "<br/>");
return description;
}
In jsf page set escape outputText property to false:
<af:outputText value="#{myBean.description}" id="ot2" escape="false"/>
The result should look like this:
public String getDescription() {
String description = (String)JSFUtils.resolveExpression("#{row.Description}");
if (description != null)
description = description.replaceAll("\n", "<br/>");
return description;
}
In jsf page set escape outputText property to false:
<af:outputText value="#{myBean.description}" id="ot2" escape="false"/>
The result should look like this:
This comment has been removed by the author.
ReplyDeleteCan you please explain it more clearly, like where should I store description kind.....
ReplyDelete