0

i got a language bundle and i want to throw an information message if saving is succesfull. In the facelet i get the message like this:

<h:messages infoClass="info" errorClass="error" escape="false" /> 

And in the Backing Bean i wrote it like that:

 fcxt.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, rb.getString("save_success"), null));

The language pattern for "save_success" is as following:

Saving successful! <br />You will receive your changes per email and also can have a look at this at your profile.

I also tried:

Saving successful! <br />You will receive your changes per email and also can have a look at this at your profile.

Did anyone know why there is no line break? And how i can get a line break?

user3049045
  • 111
  • 1
  • 1
  • 5

1 Answers1

0

There's no escape attribute in h:messages, so you may try using h:outputText like:

<h:outputText value="#{MyBean.errMsg}" escape="false"/>

And try

Saving successful! &lt;br/&gt; You will receive your changes per email and also can have a look at this at your profile.

For the language pattern. Where &lt; stands for < and &gt; stands for >.

Also, you may check this to see the code example.

Community
  • 1
  • 1
nosnhoj
  • 793
  • 1
  • 12
  • 30