我将使用struts-jquery taglib,但应用程序会引发以下错误。基于这个问题,我将struts更改为struts2,并基于这个我将bean添加到struts.xml文件但无济于事。
<%@ taglib prefix="sj" uri="/struts2-jquery-tags" %>
例外
ERROR [CommonsLogger.java:38] Unable to load configuration. - bean - jar:file:/C:/Users/Alex/Projects/Myproject/target/Myproject-1.0/WEB-INF/lib/struts2-jquery-grid-plugin-3.7.0.jar!/struts-plugin.xml:27:152
Caused by: Unable to load bean: type:org.apache.struts2.views.TagLibraryDirectiveProvider class:com.jgeppert.struts2.jquery.grid.views.JqueryGridTagLibrary - bean - jar:file:/C:/Users/Alex/Projects/Myproject/target/Myproject-1.0/WEB-INF/lib/struts2-jquery-grid-plugin-3.7.0.jar!/struts-plugin.xml:27:152
Caused by: java.lang.NoClassDefFoundError: org/apache/struts2/views/TagLibraryDirectiveProvider
Caused by: java.lang.ClassNotFoundException: org.apache.struts2.views.TagLibraryDirectiveProvider
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1761)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1611)
... 63 more
SEVERE: WebModule[]Exception starting filter struts2
java.lang.InstantiationException
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:135)
Caused by: Unable to load configuration. - bean - jar:file:/C:/Users/Alex/Projects/Myproject/target/Myproject-1.0/WEB-INF/lib/struts2-jquery-grid-plugin-3.7.0.jar!/struts-plugin.xml:27:152
Caused by: Unable to load configuration. - bean - jar:file:/C:/Users/Alex/Projects/Myproject/target/Myproject-1.0/WEB-INF/lib/struts2-jquery-grid-plugin-3.7.0.jar!/struts-plugin.xml:27:152
Caused by: Unable to load configuration. - bean - jar:file:/C:/Users/Alex/Projects/Myproject/target/Myproject-1.0/WEB-INF/lib/struts2-jquery-grid-plugin-3.7.0.jar!/struts-plugin.xml:27:152
Caused by: Unable to load configuration. - bean - jar:file:/C:/Users/Alex/Projects/Myproject/target/Myproject-1.0/WEB-INF/lib/struts2-jquery-grid-plugin-3.7.0.jar!/struts-plugin.xml:27:152
Caused by: Unable to load bean: type:org.apache.struts2.views.TagLibraryDirectiveProvider class:com.jgeppert.struts2.jquery.grid.views.JqueryGridTagLibrary - bean - jar:file:/C:/Users/Alex/Projects/Myproject/target/Myproject-1.0/WEB-INF/lib/struts2-jquery-grid-plugin-3.7.0.jar!/struts-plugin.xml:27:152
Caused by: java.lang.NoClassDefFoundError: org/apache/struts2/views/TagLibraryDirectiveProvider
Caused by: java.lang.ClassNotFoundException: org.apache.struts2.views.TagLibraryDirectiveProvider
POM.xml
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.3.8</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-convention-plugin</artifactId>
<version>2.3.14</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-dojo-plugin</artifactId>
<version>2.3.14</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts-taglib</artifactId>
<version>1.3.10</version>
</dependency>
<dependency>
<groupId>com.jgeppert.struts2.jquery</groupId>
<artifactId>struts2-jquery-plugin</artifactId>
<version>3.7.0</version>
</dependency>
<dependency>
<groupId>com.jgeppert.struts2.jquery</groupId>
<artifactId>struts2-jquery-grid-plugin</artifactId>
<version>3.7.0</version>
</dependency>
<dependency>
<groupId>com.jgeppert.struts2.jquery</groupId>
<artifactId>struts2-jquery-richtext-plugin</artifactId>
<version>3.7.0</version>
</dependency>
<dependency>
<groupId>com.jgeppert.struts2.jquery</groupId>
<artifactId>struts2-jquery-tree-plugin</artifactId>
<version>3.7.0</version>
</dependency>
<dependency>
<groupId>com.jgeppert.struts2.jquery</groupId>
<artifactId>struts2-jquery-mobile-plugin</artifactId>
<version>3.7.0</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts-annotations</artifactId>
<version>1.0.5</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
</dependency>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.20</version>
</dependency>
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.7</version>
</dependency>