struts配置web.xml提示StrutsPrepareAndExecuteFilter' is not assignable to 'javax.servlet.Filter

GOD__ 发布于 2016/01/17 20:58
阅读 2K+
收藏 0
struts配置web.xml提示 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter' is not assignable to 'javax.servlet.Filter

导入的包和报错情况如下:

项目运行报错
WARNING: Could not find action or result
There is no Action mapped for namespace [/] and action name [learn] associated with context path []. - [unknown location]
at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:185)
at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63)
at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:553)
at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:879)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:617)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1778)
at java.lang.Thread.run(Thread.java:724)


struts配置如下
    <package name="xxx" extends="struts-default">
    <action name="learn" class="main\java\action\HelloAction" method="execute">
        <result name="success">/success.jsp</result>
    </action>
</package>

HelloAction.java文件如下:

public class HelloAction extends ActionSupport{
@Override
public String execute() throws Exception {
System.out.println("正在访问action");
return "success";
}
}


加载中
0
pantrick
pantrick

class="main\java\action\HelloAction"

哪里看看到类名用反斜杠这种写法的,class="main.java.action.HelloAction"

或者spring 继承


GOD__
GOD__
哦,sorry,失误。。。。。
0
大海
大海
IntellijIDE
返回顶部
顶部