Spring的AOP事务管理默认是针对unchecked exception回滚(运行期异常,Runtime Exception)。 unchecked ,就是不用手工写try catch的exception Exception作为基类,下面还分checked exception和unchecked exception。如果客户端可以通过其他的方法恢复异常,那么这种异常就是checked ex
@Aspect @Component public class UserAop { private static final Logger logger = LoggerFactory.getLogger(UserAop.class); @Pointcut("execution(public *
@Repository 标注在持久层,即dao,用于标注数据访问。@Service 标注在业务层,即service,用于标注业务逻辑。@Controller 标注在控制层。@Component 当不明确这个类属于那个层的时候,可以使用@Component进行标注,但不建议使用@Autowired 属性加上@Autowired后不需要getter()和setter()方法,Spring会自动注入@A
Copyright © 2005-2025 51CTO.COM 版权所有 京ICP证060544号