Reputation: 71
This is my string:-
String valueofString ="<p><b>Property Location</b> <br />With a stay at Sheraton Seattle Hotel, you'll be centrally located in Seattle, steps from 5th Avenue Theater and Washington State Convention Center. This 4-star" ;
Now I need to display this string in html but html elements is printing as it is by jsp output .
I tried like this:
<c:out value="${valueofString}" escapeXml="false"/>
but it is not work for me.
any help would be appreciated .
Thank you in advance.
Upvotes: 2
Views: 11652
Reputation: 1434
This is not ideal, but you can use scriplet to do this: http://www.tutorialspoint.com/jsp/jsp_syntax.htm
<%
String valueofString ="<p><b>Property Location</b> <br />With a stay at ...";
out.write(valueofString);
%>
Something like this should be better:
Java:
String location ="Property Location";
String detail ="With a stay at ...";
JSP:
<p>
<b><c:out value="${location}" /></b><br/>
<c:out value="${detail}" />
</p>
Upvotes: 0
Reputation: 1238
Add <textarea>
</textarea>
to the begining and at the end of your string.
String valueofString ="<textarea><p><b>Property Location</b> <br />With a stay at Sheraton Seattle Hotel, you'll be centrally located in Seattle, steps from 5th Avenue Theater and Washington State Convention Center. This 4-star</textarea>" ;
Upvotes: 1