解决ServletUrlRenderer WARN警告:
[org.apache.struts2.components.ServletUrlRenderer:http-8000-1:45] - No configuration found for the specified action: 'sums' in namespace: '/example'. Form action defaulting to 'action' attribute's literal value.
struts.xml配置:
2.jsp页面
namespace,action确定
[org.apache.struts2.components.ServletUrlRenderer:http-8000-1:45] - No configuration found for the specified action: 'sums' in namespace: '/example'. Form action defaulting to 'action' attribute's literal value.
struts.xml配置:
<package name="Library" namespace="/example" extends="struts-default">
<action name="sum" class="example.HelloWorld">
<result name="positive">positive.jsp</result>
<result name="nagative">nagative.jsp</result>
</action>
</package>
2.jsp页面
<s:form action="sum" namespace="/example" >
<s:textfield name="counta" label=" 操作数1"/>
<s:textfield name="countb" label=" 操作数2" />
<s:submit value="代数和" />
</s:form>
namespace,action确定