`

struts2异常There is no Action mapped for namespace * and action name

 
阅读更多

解决There is no Action mapped for namespace *  and action name  (* 代表异常namespace名称)

参照上一篇博客中关于namespace访问顺序,可知,在每次报次异常之前都会先去访问namespace=“”的package 所以,我们可以在struts.xml文件中配置一个默认namaspace

<package name="default" extends="struts-default">
	  <default-action-ref name="notFound" />
	 	<global-results>
		 	 <result name="error">/errer.jsp</result>
		</global-results>
		   <action name="notFound">
		    <result>/404.jsp</result>
		   </action>
</package>

 

这样系统在找不到指定namespace下的action时就会跳该页面。

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics