struts2配置有命名空间的Action: 解决No configuration found for the specified action错误

 

<!--struts2配置-->

<package name="default" namespace="/login"  extends="struts-default">
    <action name="myLogin" class="test.action.LoginAction">
    	<result name="input">/index.jsp</result>
    	<result name="success">/welcome.jsp</result>
    </action>
</package>

<!--前台-->

    
   <s:form  action="myLogin" method="post" namespace="/login"  >
	   <s:textfield name="username" label="login.username"></s:textfield>
	   <s:textfield name="password" label="login.password"></s:textfield>
	   <s:submit label="login.submit"></s:submit>
   </s:form>

不需要添加.action后缀

posted @ 2010-11-21 13:52  庚武  Views(1609)  Comments(0Edit  收藏  举报