JSP output string with HTML?

I would like to output a string in a JSP page. The string contains HTML tag. How do I display the HTML version of the string in JSP?

e.g.

            `String str = "<b><u>bold and underlined</u></b>"`;

In JSP, I use <%=str%>

Instead of displaying the HTML version of the string (with bold and underlining of the text), the above string is displayed. Can you help?

I also tried

                   <% out.print(str); %>

But didnt worked for me.

8
задан shift66 22 February 2012 в 06:45
поделиться