Вопрос

Hello everyone,

today I have migrated my application from Tomcat 6 to Tomcat 7. The server started successfully without any error messages, but when I tried accessing one of the JSP files, which was previously working.

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<c:if test="${not empty sessionScope.logged_in && not pageContext.session.new && sessionScope.logged_in}" >
     <%@include file="..\menu_pages\login_module\users_panel.jsp" %>
</c:if>

this error appeared.

SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /menu_tiles/users_panel.jsp (line: 3, column: 0) "${not empty sessionScope.logged_in && not pageContext.session.new && sessionScope.logged_in}" contains invalid expression(s): javax.el.ELException: Failed to parse the expression [${not empty sessionScope.logged_in && not pageContext.session.new && sessionScope.logged_in}]
    at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)

To me ti looks like the JSTL library is either not loaded properly or I'm missing some other library. So far I have replaced my old jstl, standart jars with javax.servlet.jsp.jstl-1.2.1.jar, javax.servlet.jsp.jstl-api-1.2.1.jar.

And added this line to web.xml

<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
version="3.0">

Can you please advise me whether I'm loading the JSTL library correctly or what could be causing this issue?

Tomcat version: 7.0.53 JDK : 1.7.0_55-b13 OS: Windows

Thanks in advance, Alex

Это было полезно?

Решение

There is a system property that you can set for Tomcat 7

-Dorg.apache.el.parser.SKIP_IDENTIFIER_CHECK=true

Reference

JSP Error: contains invalid expression. Failed to parse the expression

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top