这个问题是找不到jnop连接
错误如下:
There is no Action mapped for namespace / and action name testregion. - [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:102)at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)at java.lang.Thread.run(Unknown Source)
你看看你的action的所在包的命名空间是什么,如果有命名空间的话,就首先在命名空间里面找到uri对应的action,如果没有就到默认的包里面找对应的action,你看看是不是你的命名空间没有写对或者是在你写的命名空间里面找不到对应的action,你最好检查一下
There is no Action mapped for namespace / and action name testregion
是说在struts.xml这个配置文件里面没有找到一个名字叫testregion的Action,把这个action配置上就好了。
你的action配置有问题,建议检查哈,另外建议配置action的时候,package的name和action的name写的一样,另外,可能是action的class属性木有写对,检查哈,我昨天也遇到了一样的问题,作为struts新人,一起加油哦