There are two answers here that are mostly correct regarding how to solve this problem when using Maven to solve this problem. However, both of them are not 100% full.
Using exceptions for each @ Answer to Hunter's question
This answer works. However, there will still be log messages from Tomcat regarding duplicate TLD definitions. This is because both jstl and jstl-impl artifacts include TLD definitions. To remove these posts, I think it's best to configure Maven:
<dependency> <version>1.2</version> <scope>runtime</scope> <groupId>javax.servlet.jsp.jstl</groupId> <artifactId>jstl-api</artifactId> <exclusions> <exclusion> <artifactId>servlet-api</artifactId> <groupId>javax.servlet</groupId> </exclusion> <exclusion> <artifactId>jsp-api</artifactId> <groupId>javax.servlet.jsp</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.glassfish.web</groupId> <artifactId>jstl-impl</artifactId> <version>1.2</version> <scope>runtime</scope> <exclusions> <exclusion> <artifactId>servlet-api</artifactId> <groupId>javax.servlet</groupId> </exclusion> <exclusion> <artifactId>jsp-api</artifactId> <groupId>javax.servlet.jsp</groupId> </exclusion> <exclusion> <artifactId>jstl-api</artifactId> <groupId>javax.servlet.jsp.jstl</groupId> </exclusion> </exclusions> </dependency>
This includes only jstl api classes with the necessary exceptions to avoid the problems explained in the rest of this answer.
Using newer versions of POM for @George answer
It took me a while to figure this out, but there are newer versions of the JSTL pom. This is really confusing because these new packages use similar, but slightly different naming conventions. These new versions note the dependencies of javax.servlet, javax.jsp, etc. As a provided area, so they need not be excluded. Version 1.2.1 depends on version 1.2.1 of jstl-api. And so it will work the same as above:
<dependency> <groupId>org.glassfish.web</groupId> <artifactId>javax.servlet.jsp.jstl</artifactId> <version>1.2.1</version> <scope>runtime</scope> </dependency>
This is slightly different from George's answer because I changed the scope to run time. George indicated the scope. With the provided area, the banks must be manually copied to the Tomcat lib directory, or some other dependency should have included the necessary implementation.
However, I could not find version 1.2.1 for implication in maven central, jboss repo or any other repositories. I ended up around and finally just used the local file based repository to store the jar. Dependency and jar are described here:
kaliatech Sep 20 '13 at 14:21 2013-09-20 14:21
source share