
分类:springboot项目

2023
01-13
01-13
springboot项目拦截器重定向循环问题的解决

目录SpringBoot@RestController重定向redirect解决方法如下@RestController注释下的重定向探讨背景那么springmvc内部的逻辑是如何走的呢?下面是springmvc默认的15种HandlerMethodReturnValueHandlerSpringBoot@RestController重定向redirectSpringMVC项目中页面重定向一般使用return"redirect:/other/controller/";即可。而SpringBoot使用了@RestController注解,上述写法只能返回字符串解决方法如下将一个HttpServletRe...
继续阅读 >
2022
04-30
04-30
SpringBoot项目实用功能之实现自定义参数解析器
核心点1、实现接口org.springframework.web.method.support.HandlerMethodArgumentResolversupportsParameter方法根据当前方法参数决定是否需要应用当前这个参数解析器resolveArgument执行具体的解析过程2、将自实现的参数解析器类添加到Spring容器中3、实现org.springframework.web.servlet.config.annotation.WebMvcConfigurer接口addArgumentResolvers方法,将自己的参数解析器加入到列表中动手实现有点懒,也不想直...
继续阅读 >
2022
03-01
03-01
解决springboot项目找不到resources目录下的资源问题
springboot项目找不到resources目录下的资源问题描述:将老的mvc项目转为boot后找不到resources文件夹下的资源文件原因:war包采用的是tomcat部署,tomcat会对war包进行解压,以及目录的一些操作。而springboot使用jar包部署,服务器中是不存在相关目录的。环境:springboot2.2.2RELAESE主要的API:ClassPathResourceclassPathResource=newClassPathResource(filePath);InputStreaminputStream=classPathResource.getInput...
继续阅读 >
2022
02-12
02-12
springboot 如何设置端口号和添加项目名

2021
12-16
12-16
springBoot项目如何实现启动多个实例

2021
12-13
12-13
SpringBoot项目实现关闭数据库配置和springSecurity

2021
12-10
12-10
SpringBoot项目部署在weblogic中间件的注意事项说明

2021
11-17
11-17
springboot项目不输出nohup.out日志的解决
springboot不输出nohup.out日志nohupjava-jarmgcr_pc-0.0.1-SNAPSHOT.war>/dev/null2>log&注意:这个log是一个文件,可以随意命名psaux|grep你刚刚运行的包名.jar然后会显示线程id关闭进程如5555kill-95555nohup启动程序后,nohup.out过大的解决一般百度到都会说:cp/dev/nullnohup.outcat/dev/nullnohup.out不能简单的删除那个文件,因为linux的文件管理是引用计数法。可以清空nohup日志,其实关键在于启动时的流...
继续阅读 >
2021
10-12
10-12
使用eclipse 实现将springboot项目打成jar包

2021
10-12
10-12
SpringBoot项目 文件上传临时目标被删除异常的处理方案

2021
09-10
09-10
springboot项目中实现访问druid内置监控页面

2021
09-09
09-09
SpringBoot项目中控制台日志的保存配置操作
SpringBoot控制台日志的保存配置情景:SpringBoot项目中需要把控制台日志保存下来。实现方法:1.在配置文件application-prod.yml配置如下:logging:config:classpath:logback-spring-prod.xml2.logback-spring-prod.xml这个文件是记录控制台打印日志保存的路径配置如下:<?xmlversion="1.0"encoding="UTF-8"?><!--分级别异步文件日志输出配置--><configuration><!--日志级别--><propertyname="logLeve...
继续阅读 >
2021
08-22
08-22
如何在SpringBoot项目中使用Oracle11g数据库
在SpringBoot项目中使用Oracle11g数据库具体步骤如下:1:下载ojdbc6.jar,随便放个英文目录位置就好2:命令行下输入下行,注意最后-Dfile为自己的下载目录mvninstall:install-file-DgroupId=com.oracle-DartifactId=ojdbc6-Dversion=11.2.0.1.0-Dpackaging=jar-Dfile=H:\eclpise-workspace\ojdbc6.jar3:在项目的pom文件中引入下面依赖<dependency><groupId>com.oracle</groupId><artifactId>ojdbc6</artifactId...
继续阅读 >
2021
08-08
08-08
springboot项目main函数启动的操作
