no

no

BlogJava 首页 新随笔 联系 聚合 管理
  6 Posts :: 2 Stories :: 0 Comments :: 0 Trackbacks
  1    <bean id="sessionFactory"
  2        class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
  3        <property name="configLocation"
  4            value="classpath:hibernate.cfg.xml">
  5        </property>
  6    </bean>
  7<!-- 事务管理 -->
  8    <bean id="transactionManager"
  9        class="org.springframework.orm.hibernate3.HibernateTransactionManager">
 10        <property name="sessionFactory">
 11            <ref local="sessionFactory" />
 12        </property>
 13    </bean>
 14<!-- Hibernate Transaction Interceptor Definition -->
 15    <bean id="hibernateTransactionInterceptor"
 16        class="org.springframework.transaction.interceptor.TransactionInterceptor"
 17        parent="transactionIntercetorTemplate">
 18        <property name="transactionManager">
 19            <bean id="hibernateTransactionManager"
 20                class="org.springframework.orm.hibernate3.HibernateTransactionManager">
 21                <property name="sessionFactory">
 22                    <ref bean="sessionFactory" />
 23                </property>
 24            </bean>
 25        </property>
 26    </bean>
 27<!-- Transction Intercetor's Template -->
 28    <bean id="transactionIntercetorTemplate" abstract="true">
 29        <property name="transactionAttributes">
 30            <props>
 31                <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
 32                <prop key="is*">PROPAGATION_REQUIRED,readOnly</prop>
 33                <prop key="check*">PROPAGATION_REQUIRED</prop>
 34                <prop key="insert*">PROPAGATION_REQUIRED</prop>
 35                <prop key="update*">PROPAGATION_REQUIRED</prop>
 36                <prop key="delete*">PROPAGATION_REQUIRED</prop>
 37                <prop key="*">PROPAGATION_REQUIRED</prop>
 38            </props>
 39        </property>
 40    </bean>
 41
 42<!-- 定义自动代理生成器-->
 43    <bean id="autoProxyCreator"
 44        class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
 45        <property name="interceptorNames">
 46            <list>
 47                <idref bean="hibernateTransactionInterceptor" />
 48            </list>
 49        </property>
 50        <property name="beanNames">
 51            <value>*Service</value>
 52            <!--list>
 53                <idref bean="bookService" />                                        
 54                </list-->
 55            <!--添加Service bean-->
 56        </property>
 57    </bean>            
 58<!-- DAO定义 --> 
 59    <bean id="TSysUserDao" class="com.hgs.cmb.hibernate.dao.TSysUserDAO" >
 60    <property name="sessionFactory">
 61    <ref bean="sessionFactory" />
 62    </property>
 63    </bean>
 64    <bean id="TSysDictDAO" class="com.hgs.cmb.hibernate.dao.TSysDictDAO" >
 65    <property name="sessionFactory">
 66    <ref bean="sessionFactory" />
 67    </property>
 68    </bean>    
 69<!-- SERVICE定义 -->
 70    <bean id="SysUserService" class="com.hgs.cmb.service.TSysUserService">
 71    <property name="sysUserDao">
 72    <ref bean="TSysUserDao"/>
 73    </property>            
 74    </bean>
 75    <bean id="SysDictService" class="com.hgs.cmb.service.TSysDictService">
 76        <property name="sysDictDAO">
 77            <ref bean="TSysDictDAO" />
 78        </property>
 79    </bean>
 80<!--Action定义 -->
 81    <!-- 首页Action定义 --> 
 82   <bean class="com.hgs.cmb.action.IndexAction" name="/index">
 83        <property name="fileService">
 84        <ref bean="fileService"/>
 85        </property>
 86        <property name="userService">
 87        <ref bean="SysDictService"/>
 88        </property>
 89    </bean>        
 90    <!-- 分页Action定义 --> 
 91    <bean name="/page" class="com.hgs.cmb.action.PageAction">
 92    </bean>
 93    <!-- 系统管理 Action定义 -->
 94    <bean class="com.hgs.cmb.action.ManagerAction" name="/manager,/demo">
 95        <property name="sysUserService">
 96        <ref bean="SysUserService"/>
 97        </property>
 98        <property name="sysDictService">
 99        <ref bean="SysDictService"/>
100        </property>    
101    </bean>
102    <bean class="com.hgs.cmb.action.UserAction" name="/regist,/user,/showInfo,/login,/changeuser,/modifyuser,/submituser,/modifypswd">
103        <property name="sysUserService">
104        <ref bean="SysUserService"/>
105        </property>
106        <property name="sysDictService">
107        <ref bean="SysDictService"/>
108        </property>
109    </bean>    
110    <!-- 文件制度发布 Action定义 -->
111    <bean id="fileDAO" class="com.hgs.cmb.hibernate.dao.FileDAO">
112        <property name="sessionFactory">
113            <ref bean="sessionFactory"/>
114        </property>
115    </bean>
116    <bean id="fileService" class="com.hgs.cmb.service.FileService">
117        <property name="fileDao">
118            <ref bean="fileDAO"/>
119        </property>
120    </bean>
121    <bean class="com.hgs.cmb.action.FileAction" name="/fileAdd,/fileDel,/fileShow,/getJsonMenu,/getFileList,/fileAddAction,/fileDetail,/fileMod,/fileModAction">
122        <property name="fileService">
123        <ref bean="fileService"/>
124        </property>
125    </bean>
126    <!-- 信息交流 Actiont定义 -->
127    <bean id="TBusinessBbsDAO" class="com.hgs.cmb.hibernate.dao.TBusinessBbsDAO">
128        <property name="sessionFactory">
129           <ref bean="sessionFactory"/>
130        </property>
131    </bean>    
132    <bean id="TBusinessDetailDAO" class="com.hgs.cmb.hibernate.dao.TBusinessDetailDAO">
133        <property name="sessionFactory">
134           <ref bean="sessionFactory"/>
135        </property>
136     </bean>
137    <bean id="BusinessBbsService" class="com.hgs.cmb.service.TBusinessBbsService">
138        <property name="bussinessBbsDAO">
139           <ref bean="TBusinessBbsDAO"/>
140        </property>
141    </bean>    
142    <bean id="BusinessDetailService" class="com.hgs.cmb.service.TBusinessDetailService">
143        <property name="businessBbsDAO">
144           <ref bean="TBusinessBbsDAO"/>
145        </property>
146        <property name="businessDetailDAO">
147           <ref bean="TBusinessDetailDAO"/>
148        </property>
149    </bean>
150    <bean class="com.hgs.cmb.action.BbsAction" name="/bbs">
151        <property name="businessBbsService">
152           <ref bean="BusinessBbsService"/>
153        </property>
154        <property name="businessDetailService">
155           <ref bean="BusinessDetailService"/>
156        </property>
157    </bean>
158</beans>
posted on 2008-06-17 07:28 yasoo 阅读(204) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: