这是我的字符串:-
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" ;
现在我需要在 html 中显示这个字符串,但 html 元素是通过 jsp 输出打印的。
我尝试过这样的:
<c:out value="${valueofString}" escapeXml="false"/>
但这对我来说不起作用。
如有任何帮助,我们将不胜感激。
提前谢谢您。
最佳答案
添加<textarea>
</textarea>
到字符串的开头和结尾。
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>" ;
关于java - 在jsp中显示具有html代码的字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20471199/