I'm using an h:outputText to display a value. I would like to limit the value displayed such that when it's greater than 50 characters in length, it's truncated to 50 characters and an ellipsis is appended to the truncated value. For example:
This is some text that has been trun...
I know I can achieve this in the backing bean but I was wondering if anyone knew of any tags that can achieve this without adding code to the managed been. Seems like a common use case.
Thanks.
Use Custom JSF Converters as explained in "JSF for nonbelievers". Here's an example of text truncation converter.