日期:2014-05-20  浏览次数:20790 次

ssh配置测试,找不到namespace action
各位大哥,有空时帮小弟看下。在线等!
报错信息:

2011-12-15 14:15:09,233 WARN [org.apache.struts2.dispatcher.Dispatcher] - Could not find action or result
There is no Action mapped for namespace / and action name reg. - [unknown location]
at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:177)
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:47)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:458)
at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
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:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)

struts.xml配置
<package name="default" extends="struts-default">
  <action name="reg" class="reg">
  <result name="success">/regSuc.jsp</result>
  <result name="error">/regFail.jsp</result>
  </action>
 </package>

application配置
 <bean name="reg" class="com.test.action.UserAction" scope="prototype">
  <property name="userDaoImpl" ref="userDaoImpl"></property>
 </bean>



------解决方案--------------------
你用的是struts2怎么不指定你的action的方法呢???
------解决方案--------------------
Java code
<action name="reg" class="reg">

------解决方案--------------------
你有没有修改,方法或者Action的名称? 你是怎么样访问的,代码贴出来。
------解决方案--------------------
2011-12-15 14:15:09,233 WARN [org.apache.struts2.dispatcher.Dispatcher] - Could not find action or result
There is no Action mapped for namespace / and action name reg. - [unknown location]

已经告诉你了
可能是你页面的jsp所访问的action路径写错了把字贴出来 要不就是你这个struts文件没有和被使用

------解决方案--------------------

HTTP Status 404 - There is no Action mapped for namespace / and action name reg.