struts2 基礎(chǔ)

          1. action extends ActionSupport abstract class, because it already provide some default operation(input, createErrorMessage).
          2. property is set by reflect to action, and pass to jsp(jsp is filled with these properties, jsp is a servlet, what it returned to user is HTML file)
          3. static validate happened in action method(override ActionSupport method), dynamic validation happened in action layer.
          4. change dynamic property file value in this way : thankyou=Thank you for registerling %{personBean.firstName}, Resource file can be deployed in action layer, package layer and global layer
          5. exception can be configured in bellow way:  <global-exception-mappings>
             <exception-mapping exception="org.apache.struts.register.exceptions.SecurityBreachException" result="securityerror" />
              <exception-mapping exception="java.lang.Exception" result="error" />
               </global-exception-mappings>
             
              <global-results>
                    <result name="securityerror">/securityerror.jsp</result>
               <result name="error">/error.jsp</result>
               </global-results>
          6. Wildcard Method Selection: flexible but not useful(<action name="*Person" class="org.apache.struts.tutorials.wildcardmethod.action.PersonAction" method="{1}">)
          7. integrate spring & struts 2 way: use spring plugin, main point is who to maintain action creation(spring || action), better choice is spring, you can enjoy great function of spring.
          8. Add Convention Plugin to so that you can use annotation
          9. intercepter can be configured in action level and package level.

          posted on 2011-03-29 12:07 Sheldon Sun 閱讀(243) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           
          <2011年3月>
          272812345
          6789101112
          13141516171819
          20212223242526
          272829303112
          3456789

          導(dǎo)航

          統(tǒng)計(jì)

          常用鏈接

          留言簿(3)

          隨筆檔案

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 宁河县| 确山县| 锡林浩特市| 河北省| 仙桃市| 石城县| 九龙县| 平定县| 灵宝市| 牡丹江市| 武隆县| 防城港市| 安义县| 晋江市| 开原市| 保亭| 内江市| 泗阳县| 温宿县| 长岭县| 花莲市| 淮阳县| 新河县| 泗阳县| 安顺市| 拉萨市| 屯门区| 扎兰屯市| 抚州市| 宁陵县| 米林县| 锡林浩特市| 新密市| 鲁山县| 项城市| 东宁县| 武宁县| 杭锦旗| 股票| 毕节市| 博罗县|