Link to home
Start Free TrialLog in
Avatar of chuckie474
chuckie474Flag for United States of America

asked on

Display formatted output in JSF

I have a web application that uses jsf.  My form allows a user to enter paragraphs into an h:inputTextarea component, and they can enter carriage returns and it saves the formatting correctly into the database.  After saving and closing the form, they can open that form back up in read mode to see what they had written.  I am using h:outputText to display their paragraphs, but outputText doesn't display the carriage returns.

When the user opens the form in edit mode, the carriage returns correctly display in the h:inputTextarea.  But what can I use in JSF to preserve the format of their data while in read mode?
<h:inputTextarea style="width:700px;height:100px;" value="#{paragraph.bodyText}" rendered="#{bean.mode='Edit'}"/>
 
<h:outputText value="#{paragraph.bodyText}" rendered="#{bean.mode='Read'}"/>

Open in new window

SOLUTION
Avatar of Kadhiravan
Kadhiravan
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial