显示时Struts2中的html标签出现问题

War*_*ior 2 html struts2

嗨,我有数据库,包括数据库中的HTML标签,我正在从数据库中删除数据并在UI中显示相同,但​​问题是没有得到 CC6 Filament粗体文本,我把这两个字放在html 标签之间....

数据库中的数据:

  Incandescent Lamp, <b>CC6 Filament</b> 12 Standard Package, 150 Watt, 120 Volt, PAR38, 4-5/16 Inch, Medium Side Prong, 2000 Hour, Floodlight, For Compact Flood
Run Code Online (Sandbox Code Playgroud)

用于在数据库中显示上述文本的代码在JSP中:shortDesc ="ABOUE MENTIONED TEXT"

<p><s:property value="shortDesc" /></p>
Run Code Online (Sandbox Code Playgroud)

Struts2中的数据与粗体标签一起显示....

谢谢

IHa*_*ees 5

默认情况下,属性转义HTML.你需要做这样的事情:

<p><s:property value="shortDesc" escape="false" /></p>
Run Code Online (Sandbox Code Playgroud)

更多信息:http://struts.apache.org/2.0.14/struts2-core/apidocs/org/apache/struts2/components/Property.html