当前位置: 代码迷 >> Java Web开发 >> SSH整合开发后出现的org.apache.struts2.dispatcher.Dispatcher有关问题
  详细解决方案

SSH整合开发后出现的org.apache.struts2.dispatcher.Dispatcher有关问题

热度:346   发布时间:2016-04-13 22:43:12.0
SSH整合开发后出现的org.apache.struts2.dispatcher.Dispatcher问题
2015-06-16 15:32:51,013 WARN [org.apache.struts2.dispatcher.Dispatcher] - Could not find action or result
There is no Action mapped for namespace /image and action name css. - [unknown location]
at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:189)
at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
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:475)
at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
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:1774)
at java.lang.Thread.run(Thread.java:619)

这个是什么错误啊,我的strust.xml如下:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" 
"http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<package name="struts2" extends="struts-default">
<action name="managerlogin" class="web.managerLoginAction">
<!--  配置处理结果与视图资源关系 -->
<result name="success">index.jsp</result>
<result name="failer">login.jsp</result>
</action>
<action name="userQuery" class="web.userQueryAction">
<result name="success">table.jsp</result>
</action>
</package>
</struts>    

------解决思路----------------------
没有加命名空间啊,<package name="struts2" extends="struts-default">继承struts-default默认的命名空间是“/” 而你访问的命名空间却是/image,当然找不到 了,这样改:<package name="struts2" extends="struts-default" namespace=“/image”>,或者前段请求的url里把image/去掉
  相关解决方案