O'Reilly logo

PrimeFaces Beginner's Guide by K. Siva Prasad Reddy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – displaying FacesMessage with HTML content

Let us see how to use the escape attribute, while displaying FacesMessages with HTML content. Perform the following steps:

  1. Create a form with two input fields as follows:
    <h:form id="form1" style="width: 500px; padding-left: 10px;"> <p:panel header="Messages with HTML content - Using 'escape' attribute"> <h:panelGrid columns="3"> <h:outputText value="FirstName" /> <p:inputText id="fName" value="#{messagesController.user.firstName}"/> <p:message for="fName" escape="false" /> <h:outputText value="LastName" /> <p:inputText id="lName" value="#{messagesController.user.lastName}"/> <p:message for="lName" escape="true" /> <p:commandButton value="Submit" actionListener="#{messagesController.addHtmlMessages}" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required