org.apache.struts2.dispatcher.FilterDispatcher异常
就算使简单的Helloworld程序都会提示java.lang.ClassNotFoundException:org.apache.struts2.dispatcher....
就算使简单的Helloworld程序都会提示java.lang.ClassNotFoundException:org.apache.struts2.dispatcher.FilterDispatcher异常
web.xml配置如下:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>StartStruts</display-name>
<!-- 默认首页配置 -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<!-- 过滤器的实现类 -->
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<!-- 拦截Web请求 -->
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</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>
<include file="struts-default.xml"/>
<package name="tutorial" extends="struts-default">
<action name="hello.action" class="helloworld.HelloworldAction">
<result name="SUCCESS">hello.jsp</result>
<result name="FAILED">failed.jsp</result>
</action>
</package>
</struts>
程序应该没问题,包也导入了,环境也都是配好的
求高手解答!!!!
struts程序都是这样,郁闷啊 展开
web.xml配置如下:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>StartStruts</display-name>
<!-- 默认首页配置 -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<!-- 过滤器的实现类 -->
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<!-- 拦截Web请求 -->
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</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>
<include file="struts-default.xml"/>
<package name="tutorial" extends="struts-default">
<action name="hello.action" class="helloworld.HelloworldAction">
<result name="SUCCESS">hello.jsp</result>
<result name="FAILED">failed.jsp</result>
</action>
</package>
</struts>
程序应该没问题,包也导入了,环境也都是配好的
求高手解答!!!!
struts程序都是这样,郁闷啊 展开
2个回答
展开全部
这里的设置出错了,要设置成你环境中的路径:
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
org.apache.struts2.dispatcher.FilterDispatcher 这是默认设置,你项目包里的环境是什么,直接改过去就OK了。
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
org.apache.struts2.dispatcher.FilterDispatcher 这是默认设置,你项目包里的环境是什么,直接改过去就OK了。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询