我是这样配的:<bean id="txProxyTemplate" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager" ref="myTransactionManager" />
<property name="transactionAttributes">
<props>
<prop key="save*">PROPAGATION_REQUIRED</prop>
<prop key="remove*">PROPAGATION_REQUIRED</prop>
<prop key="modify*">PROPAGATION_REQUIRED</prop>
<prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
</props>
</property>
</bean> <!-- Service primary business object implementation -->
<bean id="service" parent="txProxyTemplate">
<property name="target">
<bean class="service.BaseService">
<property name="DAO" ref="dao" />
</bean>
</property>
</bean>
<bean id="staffService" parent="txProxyTemplate">
<property name="target">
<bean class="service.impl.StaffServiceImpl">
<property name="DAO" ref="dao" />
<property name="staffDao" ref="staffDao" />
</bean>
</property>
</bean>
再在action里面通过
ServletContext servletContext = actionServlet.getServletContext();
WebApplicationContext wac =
WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
this.staffService = (StaffService) wac.getBean("staffService");调用的
<property name="transactionManager" ref="myTransactionManager" />
<property name="transactionAttributes">
<props>
<prop key="save*">PROPAGATION_REQUIRED</prop>
<prop key="remove*">PROPAGATION_REQUIRED</prop>
<prop key="modify*">PROPAGATION_REQUIRED</prop>
<prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
</props>
</property>
</bean> <!-- Service primary business object implementation -->
<bean id="service" parent="txProxyTemplate">
<property name="target">
<bean class="service.BaseService">
<property name="DAO" ref="dao" />
</bean>
</property>
</bean>
<bean id="staffService" parent="txProxyTemplate">
<property name="target">
<bean class="service.impl.StaffServiceImpl">
<property name="DAO" ref="dao" />
<property name="staffDao" ref="staffDao" />
</bean>
</property>
</bean>
再在action里面通过
ServletContext servletContext = actionServlet.getServletContext();
WebApplicationContext wac =
WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
this.staffService = (StaffService) wac.getBean("staffService");调用的
解决方案 »
- 大神帮忙看下错在哪里
- java定时执行机制的测试问题
- 请教一个关于java对象比较的问题,想了一下午了
- SSH框架中struts配置中<plug-in>问题
- 一个很困惑的问题,希望大家简答一下。关于beanUtils的。
- 200元RMB 求JAVA国际化 编码问题 UTF-8 在线等。。急死了求求大哥大姐帮帮我吧!!!!
- 放50分,像各位大虾,讨教怎样学习webservice?。。。。。。。。。。。。
- 删除实体Bean不是调用ejbRemove()函数吗?但数据库里面的那条数据还在啊
- 怎样手动地写EJB的部署文件?
- Tomcat能否支持2000人同时在线??
- 求高手指點,在jboss發佈ejb的jar時提示出錯
- 100分求struts问题
总之,如何发布多个rmi服务呢?