suppose I have a String, say:
<abc>
<xyz>
How do I print this in JSP? I have tried it,but anything between <> is supposed to be a tag and hence is not printed. Plus,to print it in two new lines also.
To make it more specific:
It’s a String that I’m fetching from a previous page and then printing the String using out.print(); .
JSTL:
<c:out escapeXml="true" value="${yourVariable}">JSP: Use StringEscapeUtils:
<%=StringEscapeUtils.escapeHtml(yourVariable)%=>HTML: Use
<pre>:<pre><%=yourVariable%></pre>