struts.xml
<struts>
<include file="struts-default.xml"></include>
<package name="struts2" extends="struts-default" namespace="/mystruts">
<action name="sum" class="action.FirstAction" >
<result name="nagetive">/nagetive.jsp</result>
<result name="positive">/positive.jsp</result>
</action>
</package>
</struts> 页面
<s:form action="sum" namespace="/mystruts">
<s:textfield name="operand1" label="操作数1"></s:textfield>
<s:textfield name="operand2" label="操作数2"></s:textfield>
<s:submit value="代数和"></s:submit>
</s:form>2011-2-23 18:35:01 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
警告: No configuration found for the specified action: 'sum' in namespace: '/mystruts'. Form action defaulting to 'action' attribute's literal value.
2011-2-23 18:35:03 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
警告: No configuration found for the specified action: 'sum' in namespace: '/mystruts'. Form action defaulting to 'action' attribute's literal value.
2011-2-23 18:35:22 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
<struts>
<include file="struts-default.xml"></include>
<package name="struts2" extends="struts-default" namespace="/mystruts">
<action name="sum" class="action.FirstAction" >
<result name="nagetive">/nagetive.jsp</result>
<result name="positive">/positive.jsp</result>
</action>
</package>
</struts> 页面
<s:form action="sum" namespace="/mystruts">
<s:textfield name="operand1" label="操作数1"></s:textfield>
<s:textfield name="operand2" label="操作数2"></s:textfield>
<s:submit value="代数和"></s:submit>
</s:form>2011-2-23 18:35:01 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
警告: No configuration found for the specified action: 'sum' in namespace: '/mystruts'. Form action defaulting to 'action' attribute's literal value.
2011-2-23 18:35:03 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
警告: No configuration found for the specified action: 'sum' in namespace: '/mystruts'. Form action defaulting to 'action' attribute's literal value.
2011-2-23 18:35:22 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货