ITeye博客

解决ServletUrlRenderer WARN警告

harbey · 2010-03-29 14:41 · struts 2.x · 企业架构 · Markdown

解决ServletUrlRenderer WARN警告:

  • 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确定

评论(1)

  1. #1 楼 · yuxingfirst · 2010-11-15 16:23

    LZ正解呀

评论功能维护中,当前仅展示历史评论。