Java JSPG0122E:无法分析Websphere 7中的EL函数
我正在将一个web应用程序移动到WebSphere7,我的JSP页面遇到了一个错误Java JSPG0122E:无法分析Websphere 7中的EL函数,java,jstl,el,websphere-7,Java,Jstl,El,Websphere 7,我正在将一个web应用程序移动到WebSphere7,我的JSP页面遇到了一个错误 JSPG0227E: Exception caught while translating /WEB-INF/jsp/snet/destinationTripReport.jsp: /WEB-INF/jsp/snet/destinationTripReport.jsp(211,8) --> JSPG0122E: Unable to parse EL function ${destForm.flightT
JSPG0227E: Exception caught while translating /WEB-INF/jsp/snet/destinationTripReport.jsp:
/WEB-INF/jsp/snet/destinationTripReport.jsp(211,8) --> JSPG0122E: Unable to parse EL function ${destForm.flightTable.get(loop.index).tripId}.
JSP中出错的部分如下所示
<c:forEach items="${destForm.flightTable}" var="entry" varStatus="loop">
<!-- content -->
<tr class="table-info">
<td>${destForm.flightTable.get(loop.index).tripId}</td>
<td>${destForm.flightTable.get(loop.index).actualArrival}</td>
<td>${destForm.flightTable.get(loop.index).comment}</td>
</tr>
</c:forEach>
${destForm.flightTable.get(loop.index.tripId}
${destForm.flightTable.get(loop.index.ActualRival}
${destForm.flightTable.get(loop.index.comment}
最让我困惑的是,它使用TOMCAT运行,但错误发生在使用Websphere时。问题
WebSphere7使用JSP2.1(JavaEE5)。JSP 2.1不支持EL表达式中的方法调用,因此${destForm.flightTable.get(loop.index)}
无效,因为在EL表达式中调用了get()
解决方案:
为了解决您的问题,EL表达式应该是${destForm.flightTable[loop.index].tripId}
,假设destForm.flightTable
是可以通过索引访问的列表/数组
注意:JSP2.2+(JavaEE6+)允许像您一样在EL表达式中调用方法。非常感谢您的帮助!很好用!