03. struts2中Action配置的各项默认值

Action中的各项默认值

  • Action各项配置jsp

    • <action name="helloworld" class="com.liuyong666.action.HelloWorldAction" method="execute" >
          <result name="success">/WEB-INF/page/hello.jsp</result>
      </action>
  • Action默认配置spa

    • <action name="helloworld">
          <result>/WEB-INF/page/hello.jsp</result>
      </action>
  • 默认值code

    1. 若是没有为action指定class,默认是ActionSupport。
    2. 若是没有为action指定method,默认执行action中的execute() 方法。
    3. 若是没有指定result的name属性,默认值为success。

相关文章
相关标签/搜索