Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top