JSPG0122E: Unable to parse EL function in Websphere 7

自古美人都是妖i 提交于 2019-12-10 11:18:15

问题


I am moving a web application to Websphere 7 and I am running into an error with my JSP page.

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}.

The portion of the JSP where the error is coming from looks like this.

<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>

What is confusing to me the most is that this runs using TOMCAT, but the error occurs while using Websphere.


回答1:


Problem

Websphere 7 uses JSP 2.1 (Java EE5). JSP 2.1 does NOT support method calls within EL expressions so ${destForm.flightTable.get(loop.index)} is invalid because of the call to get() within the EL expression.

Solution:

To solve your problem, your EL expression should be ${destForm.flightTable[loop.index].tripId} assuming that destForm.flightTable is a List/Array which can be accessed by index.

Note: JSP 2.2+ (Java EE6+) allows method calls in EL expression like you did.



来源:https://stackoverflow.com/questions/20844130/jspg0122e-unable-to-parse-el-function-in-websphere-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!