<2008年8月>
          272829303112
          3456789
          10111213141516
          17181920212223
          24252627282930
          31123456

          統計

          • 隨筆 - 20
          • 文章 - 3
          • 評論 - 8
          • 引用 - 0

          常用鏈接

          留言簿(2)

          隨筆檔案

          文章分類

          文章檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          struts中Action是非線程安全的!

          struts的action是非線程安全的。
          不要在action中定義實例變量。


          在spring的配置文件中,可以配置action為線程安全,即每次調用都生成一個新的實例,而不是只用一個實例。
          bean中設置singleton="true"

          <bean id="/itemDayAction" class="com.joyinter.skype.statistic.action.ItemDayAction" singleton="true">
              
          <property name="itemDayBO">
                  
          <ref bean="itemDayBO"/>
              
          </property>
                  
          <property name="avatarItemBO">
                  
          <ref bean="avatarItemBO"/>
              
          </property>
          </bean>

          posted on 2007-08-15 15:24 當扎瓦 閱讀(1960) 評論(1)  編輯  收藏 所屬分類: SpringStruts

          評論

          # re: struts中Action是非線程安全的! 2008-08-27 23:59 guest

          singleton默認就是true的啊
            回復  更多評論    
          主站蜘蛛池模板: 微山县| 勐海县| 木里| 乐陵市| 铁力市| 洱源县| 鱼台县| 平山县| 明溪县| 荣昌县| 枣强县| 景德镇市| 镇坪县| 柘荣县| 洪江市| 玛曲县| 石柱| 来安县| 宝坻区| 堆龙德庆县| 新绛县| 合水县| 潼南县| 淮阳县| 襄汾县| 格尔木市| 法库县| 临夏市| 德州市| 大化| 莲花县| 镇雄县| 青田县| 萨嘎县| 婺源县| 龙川县| 巧家县| 宜兰县| 阜南县| 寿宁县| 荥阳市|