Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

jsp

tomcat

jstl

el

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)

like image 542
August Bloom Avatar asked Jan 23 '12 03:01

August Bloom


1 Answers

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

like image 147
Hemant Metalia Avatar answered Sep 19 '22 06:09

Hemant Metalia