![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Spring
文章平均质量分 68
笨鸟先飞的菜鸟
下一个目标走进阿里
展开
-
几种控制Web应用中log4j日志输出相应级别的日志信息方式
这里讨论的是使用log4j1.x版本的情况。1、直接修改log4j.xml配置文件中对应logger的日志级别优点: 简单直接缺点: 需要重新启动应用2、使用org.springframework.web.util.Log4jConfigListener定时刷新常见web.xml中配置如下:<context-param> <param-name>log4jConfigLocation</param-name> <param.原创 2021-01-16 21:18:49 · 661 阅读 · 1 评论 -
Spring配置包扫描,但在对应的包路径下新增类未加载到容器
demo项目包扫描配置如下(部分):@Configuration@ComponentScan(basePackages = {"org.jackson.mvc.web"}, excludeFilters = {@ComponentScan.Filter(type = FilterType.ANNOTATION, classes = {WebFilter.class})})@EnableWebMvcpublic class ServletConfig implements WebM原创 2021-01-16 18:26:47 · 532 阅读 · 1 评论 -
使用PathVariable注解获取路径中的参数出现HTTP状态 400 - 错误的请求
参考地址:https://docs.spring.io/spring-framework/docs/current/reference/html/web.html#mvc源码地址:https://gitee.com/qinshizhang/spring-mvc-learn返回信息如下:<body><h1>HTTP状态 400 - 错误的请求</h1><hr class="line"/><p><b>类型</b>原创 2021-01-01 23:29:10 · 2822 阅读 · 0 评论 -
使用RequestBody注解传递POJO对象时返回HTTP状态码415 - 不支持的媒体类型
org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodArgumentResolver#readWithMessageConverters(org.springframework.http.HttpInputMessage, org.springframework.core.MethodParameter, java.lang.reflect.Type)HttpMessage...原创 2021-01-01 15:42:42 · 1727 阅读 · 3 评论 -
No converter found for return value of type: class xxx(自定义的class对象)
先贴一份异常信息:org.springframework.http.converter.HttpMessageNotWritableException: No converter found for return value of type: class org.jackson.mvc.web.po.RequestInfo org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProce原创 2021-01-01 03:46:05 · 750 阅读 · 0 评论