关于程序员:03-struts2中Action配置的各项默认值

3次阅读

共计 372 个字符,预计需要花费 1 分钟才能阅读完成。

Action 中的各项默认值

  • Action 各项配置

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

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

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

正文完
 0