hengheng123456789

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            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
          主站蜘蛛池模板: 中西区| 崇文区| 鄂伦春自治旗| 木兰县| 安义县| 商洛市| 张家界市| 漾濞| 文成县| 兖州市| 博野县| 阳曲县| 南通市| 隆昌县| 元谋县| 红原县| 平远县| 慈利县| 谷城县| 海宁市| 德兴市| 嵊泗县| 马边| 无极县| 兰西县| 平谷区| 平武县| 汝州市| 大城县| 若羌县| 高青县| 蒲城县| 沽源县| 叙永县| 江孜县| 兰溪市| 常山县| 凤阳县| 安徽省| 安达市| 洪湖市|