struts2訪問屬性的添加..ActionContext,在excute執行方法中添加..

          public String execute() throws Exception{//在execute方法里面應用全局應用session
                  ActionContext ac=ActionContext.getContext();
                  ac.getApplication().put(
          "app","應用范圍");//往serviceContext里放入
                  ac.getSession().put("session","session應用");//往session里面放
                  ac.put("req""request范圍");//往req里面放..
                  return "success";
              }


          ActionContext ac = ActionContext.getContext();
          ac.

          posted on 2012-06-05 16:28 youngturk 閱讀(553) 評論(0)  編輯  收藏 所屬分類: struts2

          <2012年6月>
          272829303112
          3456789
          10111213141516
          17181920212223
          24252627282930
          1234567

          導航

          統計

          公告

          this year :
          1 jQuery
          2 freemarker
          3 框架結構
          4 口語英語

          常用鏈接

          留言簿(6)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          相冊

          EJB學習

          Flex學習

          learn English

          oracle

          spring MVC web service

          SQL

          Struts

          生活保健

          解析文件

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 北安市| 灵寿县| 兴仁县| 莎车县| 绵阳市| 江达县| 原平市| 华阴市| 井冈山市| 喀喇| 克东县| 建水县| 麻栗坡县| 延吉市| 德化县| 闵行区| 长葛市| 罗定市| 县级市| 长宁区| 凤城市| 维西| 富宁县| 扶沟县| 普陀区| 宁陕县| 金门县| 塔城市| 巴东县| 吉首市| 大石桥市| 乌拉特后旗| 建平县| 田东县| 金坛市| 石棉县| 广南县| 甘南县| 富裕县| 绥滨县| 磴口县|