0
我有一块文本存储在mysql表格中作为longtext,然后使用struts bean进行检索:define for jsp。我想要检索这个文本块在jQuery UI对话框中使用,这意味着文本必须用“\ n”字符分析。目前文本出来像将文本从mysql传递到JSP页面上的javascript
emailMSG[1] = "%fn %ln,
Our records indicate that certification in %gn, %cn, %sn expire(d) on %dt.
Please take the refresher course.
Please visit our portal to log into your training.
Please ignore any messages from CITI regarding course expiration. DO NOT log in directly to the CITI site.";
我需要的数据是这种格式:
emailMSG[<%=id%>] = "%fn %ln,\n"+
"\n" +
"Our records indicate that certification in %gn, %cn, %sn expire(d) on %dt.\n"+
"\n" +
"Please take the refresher course at the training site.\n"+
"\n" +
"Please visit our portal to log into the site.\n"+
"\n"+
"Please ignore any messages from CITI regarding course expiration. DO NOT log in directly to the CITI site.";
我怎样才能获得“\ n” +数据中的字符出来mysql表的?
这里是我的代码位引用该部分(我删除了不相关的碎片):
<logic:iterate id="cel" name="CourseEmailList" scope="request">
<bean:define id="msg" property="message" name="cel" scope="page" type="java.lang.String"/>
<bean:define id="id" property="id" name="cel" scope="page" type="java.lang.String"/>
<tr>
<logic:notEmpty name="cel" property="message" scope="page">
<td><a href="#" onclick="OpenDialog(<bean:write name='cel' property='id' scope="page"/>);return false;">View/Modify</a>
<script type="text/javascript">
courseIDs[<%=id%>] = "<%= id%>";
emailMSG[<%=id%>] = "<%= msg%>";
</script>
</td>
</logic:notEmpty>
</tr>
</logic:iterate>