Cannot find tag library descriptor for snippets when using Maven

Here is my configuration in web.xml

 <listener> <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class> </listener> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> 

Here is the configuration in pom.xml

  <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-core</artifactId> <version>2.2.1</version> </dependency> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-spring-plugin</artifactId> <version>2.2.1</version> </dependency> <dependency> <groupId>org.apache.tiles</groupId> <artifactId>tiles-jsp</artifactId> <version>2.2.2</version> <type>pom</type> <scope>compile</scope> </dependency> 

He continues to talk about this: Can not find the tag library descriptor for "http://struts.apache.org/tags-tiles" when I add taglib to the layout:

 <%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles"%> 

And when I run on the server:

 SEVERE: Error configuring application listener of class org.apache.struts2.tiles.StrutsTilesListener 

Did I miss something?

+6
source share
3 answers

Thanks to Kenny Lee, I found a solution for this one week after week :( (You need to configure the eclipse project settings:

  • Right-click on the project in eclipse in the left pane in the package explorer view.
  • Select Java EE module dependencies.
  • Check (check the box) the Maven Dependencies parameter (the last option).

For Eclipse 3.6 Click here for more information.

Sometimes after setup you have to update the project or use mvn clean and mvn install and it will do the tricks

+4
source

your web.xml has no taglib declaration:

 <taglib> <taglib-uri> http://struts.apache.org/tags-tiles </taglib-uri> <taglib-location> /WEB-INF/tags-tiles.tld </taglib-location> </taglib> 
0
source

How about using the dependency versions specified in this example to find out if this works?

As answered in your related question , it looks like struts2-tiles dependency is required, and maybe you don't need struts2-spring-plugin .

0
source

Source: https://habr.com/ru/post/888007/


All Articles