Recognize Links In H:outputtext
I need to show some text using tag component. There is this requirement that if the text contains an URLs i.e. http//example.com.co, I need show it as a link.
Solution 1:
You need a function which does a regular expression replace on your string. You can use string.replaceAll()
for this.
You have multiple options to place this function.
- You can create a method in your backing bean.
- You can create a custom jsf tag (example)
- You can create a custom el function (example)
No 1 is the easiest to implement imho.
Post a Comment for "Recognize Links In H:outputtext"