I'm trying to break the text that is displayed inside the value attribute of the <h:outputText
, that works fine if i place the text directly inside the value attribute of the <h:outputText
, but if I place the same text inside the property file , it stop working
here is an example of the text
A<br />B<br />C
this works fine:
<h:outputText value="A<br />B<br />C" escape="false"/>
does not work:
<h:outputText value="#{text.someText}" escape="false"/>
code from property file:
someText = A<br />B<br />C
the only way i found is wrap the <h:outputText
with a <pre>
tag , but that's not good enough cause it changes the font of the text , it look weird , and any way I hope that there is a JSF way to achieve the line breaks when working with a property file
b.t.w I looked at the following links , but they are no good for me
JSF h:outputText line break for long words within strings
Insert a line break inside p:commandButton
Thanks ahead!
The properties files doesn't need to contain XML-escaped HTML. Properties files are not parsed by a XML parser like Facelets files. Just put the HTML plain in the properties file.
someText = A<br />B<br />C
Then you can use <h:outputText value="#{text.someText}" escape="false" />
the usual way.
Try using <:outputText escape="false" ... />
with the properties, if you want to use the formatting.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With