When I get from MyBean some text, for example, <p>Hello world</p>
and include it into jsp via jsp:getProperty
in resulting html page it will be <p>Hello world</p>
I could guess that tomcat's team did this due to security reasons but it's not behaviour that I want to get.
Q:how to get needed behaviour?
UPD:
@Jörn Horstmann
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<jsp:useBean id="xs" class="bean.XS" scope="application"></jsp:useBean>
<html>
<head><title>Test</title></head>
<body>
<c:out value="${xs.yoba}" escapeXml="true"/> <br>
<c:out value="${xs.yoba}" escapeXml="false"/> <br>
<c:out value="<p>HELLO WORLD</p>" escapeXml="true"/> <br>
<c:out value="<p>HELLO WORLD</p>" escapeXml="false"/>
</body>
</html>
Getter fun:
public String getYoba(){
return "<p>HELLO WORLD</p>" ;
}
Resulting html:
<html>
<head><title>Test</title></head>
<body>
&lt;p&gt;Год выпуска: 20 июля 2010&lt;/p&gt; <br>
<p>Год выпуска: 20 июля 2010</p> <br>
&lt;p&gt;HELLO WORLD&lt;/p&gt; <br>
<p>HELLO WORLD</p>
</body>
</html>
I want:
<html>
<head><title>Test</title></head>
<body>
<P>HELLO WORLD</P>
</body>
</html>