Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
No replies
SystemAdmin
SystemAdmin
6420 Posts
ACCEPTED ANSWER

Pinned topic Getting exception while using list.contains in JSTL on WAS 7

‏2013-02-26T01:15:11Z |
Hello All,

I am getting below exception while running my application on WAS 7. Application works fine on WAS 8.5
com.ibm.ws.jsp.translator.JspTranslationException: JSPG0227E: Exception caught while translating /WEB-INF/mbo/jsps/product/productDetails.jsp: demo.jsp(321,2) --> JSPG0122E: Unable to parse EL function ${availableFunctions.contains('SAVEPRODUCT')}. at com.ibm.ws.jsp.translator.visitor.validator.ELValidator.validateElFunction(ELValidator.java:500) at com.ibm.ws.jsp.translator.visitor.validator.ELValidator.validateELExpression(ELValidator.java:122) at com.ibm.ws.jsp.translator.visitor.validator.ELValidator.validateELExpression(ELValidator.java:149) at com.ibm.ws.jsp.translator.visitor.validator.ValidateVisitor.validateCustomTagAttribute(ValidateVisitor.java:1747)

Here availableFunctions is a list which I placed in model using below code

modelAndView.addObject("availableFunctions", availFunctions);

Code in JSP:

<c:if test="${!empty availableFunctions}">
<c:if test="${availableFunctions.contains("SAVEPRODUCT")}">
<%@ include file="../common/Header.jsp"%>
</c:if>
</c:if>

If I remove contains method and use c:forEach then works fine on WAS 7 also. But I am not sure why with contains WAS 7 is throwing exception.

thanks.