我正在将代码从 Struts1 迁移到 Struts2
Struts1代码
<input type="text" value="<c:out value="${serviceVO.notifList}"/>" name="ServicesNotifList-<c:out value="${serviceVO.globalId}"/>#<c:out value="${serviceVO.id}"/>" size="50" maxlength="1000"/>
在Struts2中
我尝试过但不起作用
<c:set var="notifListTemp" value="ServicesNotifList-"></c:set>
<c:set var="notifListTemp1" >${notifListTemp}${serviceVO.globalId}</c:set>
<c:set var="notifListTemp2" value="#"></c:set>
<c:set var="notifListTemp3" >${notifListTemp1}${notifListTemp2}${serviceVO.id}</c:set>
<s:textfield theme="simple" value="${serviceVO.notifList}" name="${notifListTemp3}"
size="50" maxlength="1000" />
where serviceVO
is display:table
id.
您不能在 Struts 标记的属性中使用 JSP EL 表达式,但幸运的是您可以使用 OGNL 表达式。不在值栈中的对象可以通过以下方式访问#attr
.
<s:textfield theme="simple" value="%{#attr.serviceVO.notifList}" name="%{#attr.notifListTemp3}"
size="50" maxlength="1000" />
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)