摘要: @ControllerAdvice @Slf4j public class GlobalDefultExceptionHandler { /** *ResponseStatus 返回状态 */ @ExceptionHandler(Exception.class) @ResponseBody @ResponseStatus(HttpStatus... 阅读全文
posted @ 2018-08-06 10:52 kasse 阅读(1030) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2018-08-06 10:09 kasse 阅读(98) 评论(0) 推荐(0) 编辑
摘要: @Autowired private ApplicationContext applicationContext; //将applicationContext转换为ConfigurableApplicationContext ConfigurableApplicationContext configurableApplicationContext = (Config... 阅读全文
posted @ 2018-08-06 10:08 kasse 阅读(1243) 评论(0) 推荐(0) 编辑
摘要: DataSourceTransactionManager transactionManager = new DataSourceTransactionManager(dataSource); TransactionTemplate transactionTemplate = new TransactionTemplate(transactionManager); ... 阅读全文
posted @ 2018-08-06 10:06 kasse 阅读(180) 评论(0) 推荐(0) 编辑