I have text that the user input in a textarea and I want to display it on a another page.
The first issue is that the linebreaks coming from the textarea are \r\n instead of br, but I could simply just replace all of them. The actual problem I need help with is displaying it after that:
h:outputText by default escapes everything, so to get the linebreaks to work I need to do escape="false", but for obvious reasons I don't want the user to be able to mess up the page by inputting other HTML tags or even worse, Javascript. So I need to somehow escape everything but the linebreaks.
How should I do this? Or is there maybe a different JSF component that would make this more simple?
Unfortunately pre tags or CSS white-space are not an option.