隨筆-61  評(píng)論-159  文章-0  trackbacks-0
          webwork和spring的整合:
          1、webwork.properties文件中加入webwork.objectFactory = spring
          2、配置web.xml

          <filter>
            <filter-name>webwork</filter-name>
            <filter-class>
             com.opensymphony.webwork.dispatcher.FilterDispatcher
            </filter-class>
           </filter>
           <filter-mapping>
            <filter-name>webwork</filter-name>
            <url-pattern>/*</url-pattern>
           </filter-mapping>
           <listener>
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
           </listener>

          </web-app>

          3、xwork.xml文件配置
          由于webwork的action交給spring的IoC來(lái)管理,xwork.xml配置簡(jiǎn)化:
             <action name="login" class="userAction">
             <result name="success">/login_success.jsp</result>
             <result name="error">/login.jsp</result>
          4、spring的applicationContext.xml配置
          <bean id="userAction" class="org.apple.action.UserAction">
            <property name="userService">
             <ref bean="userService"/>
            </property>
           </bean>
          經(jīng)過(guò)幾步的配置,webwork和spring的整合完成。

          -------------------------------------------------------------------------------------------------
          PS:本博客文章,如果沒(méi)有注明是有“轉(zhuǎn)”字樣,屬于本人原創(chuàng)。如果需要轉(zhuǎn)載,務(wù)必注明作者文章的詳細(xì)出處地址,否則不允許轉(zhuǎn)載,多謝合作!
          posted on 2007-10-02 23:50 apple0668 閱讀(1410) 評(píng)論(2)  編輯  收藏 所屬分類: spring 、webwork

          評(píng)論:
          # re: webwork與spring整合 2007-10-12 16:32 | Ankey
          沒(méi)有這句webwork.objectFactory = spring 怎么整合spring啊!  回復(fù)  更多評(píng)論
            
          # re: webwork與spring整合 2007-10-12 19:25 | apple0668
          @Ankey說(shuō)的確實(shí)是,要在webwork.properties文件里面加入:webwork.objectFactory = spring

          PS:我的第一點(diǎn)不是說(shuō)明了1、webwork.properties文件中加入webwork.objectFactory = spring么?你沒(méi)看清楚吧!  回復(fù)  更多評(píng)論
            
          主站蜘蛛池模板: 临武县| 天台县| 沙河市| 长兴县| 璧山县| 洪洞县| 绥中县| 新乡县| 桃江县| 岐山县| 济源市| 分宜县| 乌兰浩特市| 灵丘县| 黄浦区| 宜丰县| 盖州市| 罗平县| 来安县| 和田市| 许昌县| 永昌县| 鹰潭市| 女性| 黄梅县| 宜兰县| 呼玛县| 潞西市| 侯马市| 岳西县| 临颍县| 津市市| 永胜县| 都兰县| 芷江| 奎屯市| 道孚县| 吉水县| 阜南县| 高平市| 合水县|