我需要从表中提取所有消息并显示在 jsp 页面上。我有如下代码:
我将消息列表存储为:
SimpleStringVO 字符串值:欢迎来到 XYZ Tool 主页。 ,SimpleStringVO 字符串值: 在这里您可以输入您的帐号,SimpleStringVO 字符串值: ,SimpleStringVO 字符串值: 谢谢
当我尝试在 jsp 页面中显示此内容时,该消息在存储时未格式化。 “谢谢”紧接在第二根弦之后。我需要显示空格字符串,然后显示“谢谢”字符串。 (第三个字符串只有空格)我在 Jsp 中的代码是这样的:
<td><logic:iterate name="AllNewsCashe" id="news" type="com.fw.valueobject.SimpleStringVO">
<bean:write name="news" property="stringValue"/>
</logic:iterate>
</td>
如何在不格式化的情况下显示此消息?
I need to pull all teh messages from a table and display on the jsp page. I have the code like below:
I have the list of messages stored as :
SimpleStringVO string value: Welcome to the XYZ Tool homepage. ,SimpleStringVO string value: Here you can enter your account number ,SimpleStringVO string value: ,SimpleStringVO string value: thank you
When I tried to display this in jsp page, the message is not formated as it is stored. "thank you" comes immediately after the 2nd string. I need to display the space string and then the "thank you" string. (3rd string has just spaces) My code in Jsp is like this :
<td><logic:iterate name="AllNewsCashe" id="news" type="com.fw.valueobject.SimpleStringVO">
<bean:write name="news" property="stringValue"/>
</logic:iterate>
</td>
how to display thise messages as it is without formating ?
发布评论
评论(1)
如果您需要在 HTML 中强制使用空格,则需要将其存储为
而不是
" "
。但是,由于您使用的是bean:write
标记,因此您可以使用filter
属性来保留" "
:-这是
从 Struts 文档过滤
:-If you need to force a space in HTML, you will need to store it as
instead of
" "
. However, since are you usingbean:write
tag, you can probably usefilter
property to retain" "
:-Here's the description of
filter
from Struts documentation:-