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

解决方案 »

  1.   

    namespace有错 不过不清楚建议不要配置,这个指的是文件夹的意思
      

  2.   

    我以前遇到过一次这样的错误,但是现在记不清了,就是在<form>表单中添加一个namespace!在form表单中的action最好写全:xxxx.action这样最保险!!当然也可以直接把namespace加到action中。
      

  3.   

    <s:form action="/mystruts/sum.action">
      

  4.   

    <form action = "sum.action">
      

  5.   

    还有可能是你命名空间的问题,把namespace="/mystruts"删了 试试