Correctly configure the maven dependency of jstl and solve the jar package conflict.
It has been a headache for two days. Now we have a solution. In the end, I am not familiar with maven. I always complain that maven is not easy to use and there are various problems with no headers. These problems are due to lack of familiarity with it. It provides a good solution, but we usually do not know it.
Problem Background: Configure jstl dependencies,
<Dependency>
<GroupId> javax. servlet. jsp. jstl </groupId>
<ArtifactId> jstl-api </artifactId>
<Version> 1.2 </version>
</Dependency>
<Dependency>
<GroupId> org. glassfish. web </groupId>
<ArtifactId> jstl-impl </artifactId>
<Version> 1.2 </version>
</Dependency>
Please refer to this dependency, yes, it is the jstl jar package for you to complete the entire underground down, but it is actually attached to the jstl dependent jar package like servlet-api.jar, jsp-api.jar together down !!! So the question is, yes, most of your projects also need to use these two jar packages, and these two jar packages are needed. But do you know what the following is scary? I don't know how compatible the middleware version is for everyone. The two packages in my tomcat are in conflict with the packages under maven in my project !!! It seems that deleting the two packages in tomcat still does not work. Let's take a look at how to make reliable solution: From share: http://www.javacoder.cn /? P = 195
<Dependency>
<GroupId> javax. servlet. jsp. jstl </groupId>
<ArtifactId> jstl-api </artifactId>
<Version> 1.2 </version>
<Exclusions>
<Exclusion>
<GroupId> javax. servlet </groupId>
<ArtifactId> servlet-api </artifactId>
</Exclusion>
<Exclusion>
<GroupId> javax. servlet. jsp </groupId>
<ArtifactId> jsp-api </artifactId>
</Exclusion>
</Exclusions>
</Dependency>
<Dependency>
<GroupId> org. glassfish. web </groupId>
<ArtifactId> jstl-impl </artifactId>
<Version> 1.2 </version>
<Exclusions>
<Exclusion>
<GroupId> javax. servlet </groupId>
<ArtifactId> servlet-api </artifactId>
</Exclusion>
<Exclusion>
<GroupId> javax. servlet. jsp </groupId>
<ArtifactId> jsp-api </artifactId>
</Exclusion>
<Exclusion>
<GroupId> javax. servlet. jsp. jstl </groupId>
<ArtifactId> jstl-api </artifactId>
</Exclusion>
</Exclusions>
</Dependency>
Dear friends, have you ever encountered the same distress as me? Please try it. If it can help you, I am also very happy !!!