JSF 2.0: Limit value of h:outputtext to a specific number of characters

You can use JSF EL.. for example

<h:outputText value="#{bean.string.length() gt 50 ? bean.string.substring(0,47).concat('...') : bean.string}" />

As BalusC mentioned, OmniFace's of:abbreviate() could be a good solution for your problem:

<p>Abbreviate a long string: #{of:abbreviate(string1, 20)}</p>

Use Custom JSF Converters as explained in "JSF for nonbelievers". Here's an example of text truncation converter.

Tags:

Jsf

Jsf 2