Maven project configuration EL expression is output solutions

  • Maven build web projects in the jsp page using EL expressions, EL expression content is output as cause abnormalities. pom.xml file to add the following jar package references
 1         <dependency>
 2             <groupId>javax.servlet</groupId>
 3             <artifactId>jstl</artifactId>
 4             <version>1.2</version>
 5         </dependency>
 6       
 7         <dependency>
 8             <groupId>taglibs</groupId>
 9             <artifactId>standard</artifactId>
10             <version>1.1.2</version>
11         </dependency>   
  • maven is generated such web.xml
<!DOCTYPE web-app PUBLIC
 "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
 "http://java.sun.com/dtd/web-app_2_3.dtd" >
 
<web-app>
 
  • You need to modify the web.xml. The reason is because the maven generated web.xml version is too low, before 2.5 is defined in the web.xml file, EL expression parsing of default is negligible, so the need to show resolve el expression statement
1 <web-app version="3.0"
2          xmlns="http://java.sun.com/xml/ns/javaee"
3          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
5          http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
  • Also you can use jsp page statement EL expressions 
1 <%@ page isELIgnored="false" %>

 

Guess you like

Origin www.cnblogs.com/d191/p/11689610.html