I am using primefaces and I would like to display to users the non-printable characters ( \n,\t,\r - should be shown as they are, not rendered).
I use the <h:outputText>
command. I read the content from a file.
For example, the file has the following content:
test
new line
a new line
In java, windows this renders as: test\n new line\n a new line
.
The output should be the same :Hello\n newline\n a new line
.
How can I do that? The values are not printed at all: "Hello new line a new line".
Found solution: To render properly (e.g '\n' should be displayed) I added a new backslash: \n became \\n.
Thank you, Luisa