Use Maven to create a Web project can not use EL expressions solutions

Performance issues

Use Maven to build a Web project can not use the EL expressionSolution:

1. We can add add maven dependent standard.jarandjstl.jar

 <!-- https://mvnrepository.com/artifact/taglibs/standard -->
 <!--tarlib指令所需依赖-->
<dependency>
   <groupId>taglibs</groupId>
    <artifactId>standard</artifactId>
    <version>1.1.2</version>
</dependency>

<!-- https://mvnrepository.com/artifact/javax.servlet/jstl -->
<!--jstl标签库所需依赖-->
<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>jstl</artifactId>
    <version>1.2</version>
</dependency>

      Generally not introduce these two libraries in the preparation of the code should be given it, which is used in the jsp head tarlibintroduced jstlit will be smart when IDE tag library marked red. If none of the above situation it is very likely that the second case.

  1. 使用了Maven项目自动生成的web.xml中的内容
    Use the Web project Maven build their own web.xml

      We can solve the problem by modifying the contents in web.xml, web.xml must be in the following format.

<?xml version="1.0" encoding="UTF-8"?>
<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_3_0.xsd"
         version="3.0">
         
	/*配置信息*/
	
</web-app>

Correct the error
      After editing project is started again, you can use el表达式the.
Content loaded correctly

Published 56 original articles · won praise 17 · views 6216

Guess you like

Origin blog.csdn.net/qq_43199016/article/details/101066965