tomcat启动时提示:
严重: Exception starting filter struts2
Unable to load configuration. - bean - jar:file:/C:/Tomcat%206.0/webapps/my/WEB-INF/lib/struts2-core-2.1.4.jar!/struts-default.xml:46:1785个核心包我都导入了
请教老师指导一下
严重: Exception starting filter struts2
Unable to load configuration. - bean - jar:file:/C:/Tomcat%206.0/webapps/my/WEB-INF/lib/struts2-core-2.1.4.jar!/struts-default.xml:46:1785个核心包我都导入了
请教老师指导一下
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="struts2" extends="struts-default">
<action name="login" class="com.wangxin.action.LoginAction">
<result>/result.jsp</result>
</action>
</package>
</struts>
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<welcome-file-list>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list> <filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter> <filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping></web-app>
还有导入的5个JAR包
commons-logging-1.0.4.jar
freeer-2.3.13.jar
ognl-2.6.11.jar
struts2-core-2.1.4.jar
xwork-2.1.2.jar
struts.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="struts2" extends="struts-default">
<action name="login" class="com.wangxin.action.LoginAction">
<result>/result.jsp </result>
</action>
</package>
</struts>
2.struts2-core-2.1.6版本,但需要加commons-io-1.3.2.jar和commons-fileupload-1.2.1.jar两个包。注:官方网站http://struts.apache.org/download.cgi#struts216