all gone

          all gone

          #

          EJB3.0 + Struts小試

               摘要: 一直想做一個 EJB3.0 結合 Struts 的例子,前天剛好從網上找到了一個相關的 Tutorial ,于是小試了一把,雖然只是完成了 Tutorial 上的一小點功能,但是感覺還是有必要寫下來,免得以后還要再去看別人的Tutorial 。 開發環境:?? ??? Eclipse3.2 + WTP1.5 , JBoss 4.0.3SP1 , jboss-EJB-3.0_RC...  閱讀全文

          posted @ 2006-08-11 13:52 all gone 閱讀(3074) | 評論 (0)編輯 收藏

          SSH(Spring + Struts + Hibernate)小試 之三

          SSH(Spring + Struts + Hibernate)小試 之三


          前面通過PlugIn我們實現了Spring Context的加載,不過僅僅加載Context并沒有什么實際
          意義,我們還需要修改配置,將Struts Action交給Spring容器進行管理。下面將通過一個Regsit
          實例加以說明。

          首先準備好regist.jsp和login.jsp,在regist.jsp中 的form有name,password,password2,email域。

          在struts-config.xml中添加配置:

          <form-bean name="registForm" type="com.lzy.forum.form.RegistForm" />

          <action path="/regist" name="registForm"
          type="org.springframework.web.struts.DelegatingActionProxy"

          validate="true" input="/regist.jsp" scope="request">
          <forward name="failure" path="/regist.jsp" />
          <forward name="success" path="/login.jsp" />
          </action>


          RegistForm,RegistAction按照原來Struts的方法去寫,我在RegistAction中加入了一個UserDAO對象
          userDAO,這個對象由Spring注入。

          <bean name="/regist" class="com.lzy.forum.action.RegistAction"
          singleton="false">
          <property name="userDAO">
          <ref local="userDAO" />
          </property>
          </bean>

          基本上SSH的架構已經完成,經確認后可以自己測試一下了。(完)

          posted @ 2006-07-18 16:41 all gone 閱讀(655) | 評論 (1)編輯 收藏

          僅列出標題
          共17頁: 上一頁 1 2 3 4 5 6 7 8 9 下一頁 Last 
          主站蜘蛛池模板: 饶河县| 金堂县| 左权县| 岑溪市| 汉沽区| 卓尼县| 兴文县| 桐城市| 炉霍县| 无极县| 绵竹市| 伊春市| 安达市| 青州市| 永兴县| 禹城市| 西林县| 龙海市| 银川市| 陕西省| 达日县| 沾益县| 荔波县| 寻乌县| 平遥县| 永川市| 青岛市| 旅游| 五莲县| 女性| 上林县| 芮城县| 崇仁县| 墨竹工卡县| 马关县| 奈曼旗| 巴林左旗| 台江县| 大英县| 华宁县| 犍为县|