我需要将支持bean中的字符串数组传递给JSP。我可以使用h:dataTable并将每个字符串作为h:列条目显示,没有任何问题。但是我需要在警告框中显示这个字符串列表,而不是将它嵌入JSP本身。我如何将列表传递给JavaScript函数并对其进行迭代?然后我想将每个字符串附加到一个变量并显示它。如何遍历JavaScript中的支持bean字符串列表
这里是原始数据表:
<h:dataTable id="scriptCommandTable" value="#{viewScriptRules.scriptCommands}" var="scriptCommand" columnClasses="scriptCommandSequence,scriptCommandRule" rendered="#{viewScriptRules.scriptCommandsSize > 0}">
<h:column>
<h:outputText value="#{scriptCommand.sequence}."/>
</h:column>
<h:column>
<h:outputText value="#{scriptCommand.rule}" escape="false"/>
</h:column>
</h:dataTable>
好主意!从来没有想到这一点。我会给它一个镜头。 – user246392 2011-03-09 22:58:32