03. struts2中Action配置的各項默認值

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。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章