IC5Notice: We have upgraded developerWorks Community to the latest version of IBM Connections. For more information, read our upgrade FAQ.
Topic
  • No replies
SystemAdmin
SystemAdmin
6420 Posts

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.