下面是在struts1 JSP页面中编写的一行代码,以及如何将其转换为Struts2 JSP页面。
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<bean:define id="clientOptions" name="XYZ" property="clients" type="java.util.Iterator"/>
<html:select name="XYZ" property="id" onfocus="SCV(this.selectedIndex)" onchange="selectClient(this)">
<html:options collection="clientOptions" labelProperty="name" property="id" />
</html:select>
谁能告诉我,struts2 中的等效代码是什么?
最佳答案
我认为你可以使用:
<s:set var="newVariable" value="bean.property"/>
这里有文档:
关于java - 相当于 <bean :define> in struts 2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27060455/