![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
springboot
文章平均质量分 68
追梦去火星
这个作者很懒,什么都没留下…
展开
-
springboot2当前不支持log4j2.17.0版本解决办法
移出springboot版本内置自带log4j(蓝色),外部单独引用jar包版本(绿色)<!-- Spring Boot log4j依赖 --><!--<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-log4j2</artifactId></dependency&g.原创 2021-12-28 16:57:29 · 957 阅读 · 0 评论 -
springboot使用ServletContextListener启动报错
ServletContextListener是servlet容器中的一个API接口, 它用来监听ServletContext的生命周期,也就是相当于用来监听Web应用的生命周期。使用配置如下import lombok.extern.slf4j.Slf4j;import org.springframework.stereotype.Component;import javax.ser...原创 2018-11-29 09:23:52 · 2431 阅读 · 0 评论 -
springboot通过new关键字创建的类中 @Resource 注解的对象没有成功注入,无法调用service层接口
Springboot项目中 new 创建的对象中无法使用@Resource 或@Autowired 注解实例化service层注入那么如何引用呢,web启动类中注入 service 对象 设置为static new创建的对象 类中引用,测试不可实现,以为静态变量 不能用@Resource 或@Autowired 注入,所以可通过以下方式实现,将注入的方法正常注入fService对象 @Re...原创 2018-11-29 09:40:02 · 8768 阅读 · 1 评论 -
springboot获取 static文件夹的绝对路径,适用于内置targert或部署外部tomcat
public static String getUrl() { String path = null; try { String serverpath= ResourceUtils.getURL("classpath:static").getPath().replace("%20"," ").replace('/', '\\'); path=serverpath.s...原创 2018-11-29 09:52:11 · 10848 阅读 · 0 评论 -
SpringBoot List 向后台传值 接收错误
SpringBoot 采用注解开发是遇到 ajax json格式 提交POST 请求参数带List 向后台传值 参数如下:出现提交500错误,类型匹配报错开发工具 报错内容如下:Neri如下{"timestamp":"2018-12-06T08:49:00.791+0000","status":500,"error":"Internal Server Error","message.原创 2018-12-06 16:59:07 · 2838 阅读 · 0 评论 -
springboot2 继承WebMvcConfigurationSupport 后自动配置失效,swagger-ui.html 无法访问
项目中使用callable 返回,释放tomcat线程 增加吞吐量 //列表查询 @ApiOperation(value = "职务、部门、工种列表", notes = "下拉框列表,职务、部门、工种列表大数据高性能") @RequestMapping(value = "/listParatest", method = RequestMethod.GET) pu...原创 2019-01-24 11:29:15 · 6813 阅读 · 0 评论 -
spring boot实现web页面动态增删启停定时任务
在spring boot项目中,可以通过@EnableScheduling注解和@Scheduled注解实现定时任务,也可以通过SchedulingConfigurer接口来实现定时任务。但是这两种方式不能动态添加、删除、启动、停止任务。 要实现动态增删启停定时任务功能,比较广泛的做法是集成Quartz框架。在满足项目需求的情况下,尽量少的依赖其它框架,避免项目过于...转载 2019-06-27 16:28:49 · 1130 阅读 · 0 评论