我有一个 Struts 项目,我们在其中迭代列表列表。它在 JDK 1.8 和 tomcat 8 上运行良好,但是当我们升级到 JDK 11 和 tomcat 9 时,我们开始出现以下错误:
**javax.servlet.jsp.JspException: Cannot find bean: "jobName" in any scope**
下面是请求中设置ALNAME的源码,供大家参考:
<logic:present scope="request" name="ALNAME">
<logic:iterate id="arrayName" name="ALNAME" scope="request" length="1">
<tr>
<td class="tableHeader" align="center">
<%java.text.SimpleDateFormat df = new java.text.SimpleDateFormat("HH:mm:ss");%>
<%java.util.Calendar cal = java.util.Calendar.getInstance();%>
<%=df.format(cal.getTime())%>
</td>
<logic:iterate id="jobName" name="arrayName">
<td align="center" class="tableHeader">
<bean:write name="jobName"/>
</td>
</logic:iterate>
</tr>
</logic:iterate>