java.lang.ClassNotFoundException: ora.apache.struts2.dispatcher.FilterDispatche报错怎么解决啊?
myeclipse9.0+tomcat6.0web-xml如下:<?xmlversion="1.0"encoding="UTF-8"?><web-appversion="...
myeclipse9.0+tomcat6.0
web-xml如下:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<filter>
<filter-name>struts2</filter-name>
<filter-class>ora.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<!--Struts2的Filter的URI配置 -->
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
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.struts2.action.LoginAction">
<result name="success">/welcome.jsp</result>
<result name="error">/error.jsp</result>
</action>
</package>
</struts> 展开
web-xml如下:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<filter>
<filter-name>struts2</filter-name>
<filter-class>ora.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<!--Struts2的Filter的URI配置 -->
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
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.struts2.action.LoginAction">
<result name="success">/welcome.jsp</result>
<result name="error">/error.jsp</result>
</action>
</package>
</struts> 展开
展开全部
应该是这句的问题:<filter-class>ora.apache.struts2.dispatcher.FilterDispatcher</filter-class>
把类换成这个看看:org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
把类换成这个看看:org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
追问
严重: Dispatcher initialization failed
Unable to load configuration. - bean - jar:file:/D:/Java/JavaTool/Tomcat%206.0/webapps/LoginStruts2/WEB-INF/lib/struts2-osgi-plugin-2.3.1.2.jar!/struts-plugin.xml:15:113
又变成这个错误啦
追答
添加如下架包
struts2-core-2.1.8.1.jar
xwork-core-2.1.6.jar
commons-fileupload-1.2.1.jar
commons-io-1.3.2.jar
ognl-2.7.3.jar
freemarker-2.3.15.jar
然后把web.xml中的配置改成如下
struts
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
config
struts-default.xml,struts-plugin.xml,config/struts/struts.xml
struts
/*
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询