jsp does not support EL expressions for the solution

  • 2020-05-10 18:37:54
  • OfStack

If you have the following, it means Servlet 2.3 / JSP 1.2.
< !--CTYPE web-app PUBLIC < /sp-- >
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
By default, Servlet 2.3 / JSP 1.2 does not support EL expressions, while Servlet 2.4 / JSP 2.0 does.
web.xml does not support EL expressions if the following Settings are set:
< web-app version="2.5"
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" >
Solutions:
1. Modify web.xml to (Servlet 2.4 / JSP 2.0) :
< web-app version="2.4"
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_4.xsd" >
2. Set an jsp page to use the el expression, which needs to be added to the jsp page (to control a single page).
< %@ page isELIgnored="false"% >
< jsp-config >
< jsp-property-group >
< url-pattern > *.jsp < /url-pattern >
< el-ignored > false < /el-ignored >
< /jsp-property-group >
< /jsp-config >

Related articles: