We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.ApplicationContext_bean.xml中,去掉对controller的扫描
<context:component-scan base-package="com.trans"> <context:exclude-filter type="annotation" ="org.springframework.stereotype.Controller" /> </context:component-scan>
2.ApplicationContext_mvc.xml中,去掉对 service的扫描,加入对controller的扫描
<context:component-scan base-package="cn.easyproject.easyee"> <context:include-filter type="annotation" ="org.springframework.stereotype.Controller"/> <context:exclude-filter type="annotation" ="org.springframework.stereotype.Service"/> </context:component-scan>
3.将以下代码移至 applicationContext.xml中
<!-- 3. TransactionManager --> <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"> <property name="entityManagerFactory" ref="entityManagerFactory"></property> </bean> <tx:annotation-driven transaction-manager="transactionManager" /> <!-- 开启 Schema 式事务管理 --> <tx:advice id="txAdvice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name="insert*" propagation="REQUIRED"/> <tx:method name="add*"/> <tx:method name="save*"/> <tx:method name="new*"/> <tx:method name="create*"/> <tx:method name="del*"/> <tx:method name="remove*"/> <tx:method name="destory*"/> <tx:method name="update*"/> <tx:method name="edit*"/> <tx:method name="change*"/> <tx:method name="move*"/> <tx:method name="*" read-only="true" /> </tx:attributes> </tx:advice> <!-- AOP 将通知织入切点表达式指定的方法--> <aop:config> <!-- SYS 事务 AOP --> <aop:advisor advice-ref="txAdvice" pointcut="execution(* cn.easyproject.easyee.sh.sys.service..*.*(..))" /> <!-- 自定义模块事务配置.... --> </aop:config>
必须配置在 applicationContext.xml 中
The text was updated successfully, but these errors were encountered:
No branches or pull requests
1.ApplicationContext_bean.xml中,去掉对controller的扫描
2.ApplicationContext_mvc.xml中,去掉对 service的扫描,加入对controller的扫描
3.将以下代码移至 applicationContext.xml中
必须配置在 applicationContext.xml 中
The text was updated successfully, but these errors were encountered: