hengheng123456789

            BlogJava :: 首頁 :: 聯(lián)系 :: 聚合  :: 管理
            297 Posts :: 68 Stories :: 144 Comments :: 0 Trackbacks

          A while back , I wrote an article for O’Reilly’s sister site , Java.net about How to add Ajax to your Struts Application. While it was pretty straightfoward (as is Ajax underneath all the hype), it still involved a little to much JavaScript for my liking. Nothing against JavaScript, but if you write it , you have to support it. Far better to use a standard Ajax library , like DWR , Prototype or Dojo.

          So , along comes Struts 2. Be careful - it’s good , but a different beast under the covers from Struts 1. It does a lot of things better - for example , the way it has Actions as normal POJO’s makes it a lot of things easier to unit test.

          Struts 2 also gives you Ajax ‘out of the box’. No writing of javascript, no debugging against various browsers; just configure and go. A full description of how to setup Struts 2 to use Ajax is in this wiki article. The quick version is:

          1. Setup Struts 2
          2. Add the Struts-Ajax URL and Div Tag.

          That’s it. Ajax without the fuss.

          Even better that the Struts guys have implemented the Ajax functionality using the Prototype Ajax Library, so you get the benefit of all the improvements there.

          What do you think? Will you move to Struts 2 just for the new Ajax capabilities?

          posted on 2007-09-03 17:41 哼哼 閱讀(428) 評論(0)  編輯  收藏 所屬分類: JAVA-Web
          主站蜘蛛池模板: 东乌珠穆沁旗| 司法| 吕梁市| 菏泽市| 河北区| 佛教| 青神县| 定安县| 呼伦贝尔市| 兴海县| 吉隆县| 玉树县| 常德市| 宜丰县| 天峨县| 高安市| 竹北市| 福泉市| 黄浦区| 沙雅县| 福鼎市| 永寿县| 大冶市| 银川市| 台州市| 乐至县| 普兰店市| 梧州市| 林州市| 军事| 常熟市| 武城县| 三门峡市| 呼伦贝尔市| 鹿邑县| 南漳县| 安达市| 新蔡县| 安义县| 根河市| 商洛市|