![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
spring
mobile18600007978
活到老学到老,分享已知,学习未知;
且行且思考,且行且总结
展开
-
@Autowired和@Resource区别
@Autowired @Resource原创 2022-11-03 11:12:50 · 120 阅读 · 0 评论 -
util:properties和context:property-placeholder区别和共性
配置方式:<util:properties location="classpath:development.properties" id="config" /><context:property-placeholder location="classpath*:development.properties" ignore-unresolvable="true" ignore-resource-not-found=原创 2020-05-08 18:19:22 · 710 阅读 · 0 评论 -
java.lang.IllegalArgumentException: No converter found for return value of type类型转换错误
java.lang.IllegalArgumentException: No converter found for return value of type: class com.data.wallet.saf.common.Result at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConver...原创 2020-04-28 11:40:49 · 357 阅读 · 0 评论 -
springMVC 使用统一异常注解拦截@ExceptionHandle遇到的问题解决
项目使用spring框架(spring4.3版本),MVC模式,接口是restful方式,通过json格式进行数据交互,controller层通过注解@ResponseBody返回json数据;在架构设计中的异常处理是service层及更底层有问题就向上抛异常,Controller层捕获所有异常,为了省去每个方法处理逻辑时try…catch的冗余及代码的复杂性,通过使用springMvc注解@E...原创 2020-04-28 10:18:34 · 2559 阅读 · 0 评论 -
controller层统一处理异常
所有的controller继承此BaseController,BaseController使用@ExceptionHandler拦截异常,此异常的处理原理参照:此篇@Slf4jpublic class BaseController { @ExceptionHandler @ResponseBody public Result exception(HttpServlet...原创 2020-04-24 16:29:12 · 1089 阅读 · 0 评论 -
Spring注解@Resource和@Autowired区别对比
Spring注解@Resource和@Autowired区别对比原创 2020-04-16 09:56:41 · 141 阅读 · 0 评论