Reputation: 23
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.
Upvotes: 2
Views: 3073
Reputation: 9655
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.
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.
Upvotes: 6