JSTL EL invalid expression(s): javax.el.ELException: in Tomcat 7
Asked Answered
C

1

7

I'm trying to get this old JSP project running in Tomcat 7, JRE7 but getting this error in most of the pages in the project. Can any one please shed some light whats happening?

The code looks like:

<c:set var="structClass">
    <c:if test="${empty param.class}">template</c:if>
    <c:if test="${not empty param.class}">${param.class}</c:if>
</c:set>

The error looks like:

org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: org.apache.jasper.JasperException: /WEB-INF/templates/template.jsp (line: 77, column: 4) "${empty param.class}" contains invalid expression(s): javax.el.ELException: Failed to parse the expression [${empty param.class}] org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:585) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:455)

Cuff answered 23/1, 2012 at 3:56 Comment(0)
M
13

it is because of 'class' keyword in the expression try to use

<c:if test="${empty param['class']}">template</c:if>
<c:if test="${not empty param['class']}">${param['class']}</c:if>

refer http://geekomatic.ch/2011/03/22/1300804080000.html

Meanwhile answered 23/1, 2012 at 4:3 Comment(3)
now the error changes to => org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: java.lang.NoSuchFieldError: deferredExpressionCuff
geekomatic.ch/2011/03/22/1300804080000.html I added -Dorg.apache.el.parser.SKIP_IDENTIFIER_CHECK=true and that solved the issue.... thanks for the link!!!Cuff
${something.new} also says same error because of new keyword. Thanks.Infix

© 2022 - 2024 — McMap. All rights reserved.