springboot
love_燕子
早年偶遇始相知,一载瞬逝情却萌。年少不知愁滋味,犹读红豆生南国。别离方知相思苦,心田红豆根以生。
展开
-
springboot集成jsp
输入地址:http://127.0.0.1:8081/client/static/js/jquery.min.js 查看静态文件。输入地址:http://127.0.0.1:8081/client/v1/index 访问jsp。在main下创建webapp文件夹并进行如下设置File—>Projec Structure中。将webapp下的所有文件打包到target文件下的META-INF/resources下。点击加号选择刚才的webapp文件夹。然后该文件夹就是显示多个点即可。原创 2024-01-10 12:00:00 · 448 阅读 · 0 评论 -
springboot之actuator监控管理
可以使用http的各种请求来监管、审计、收集应用的运行情况,特别对于微服务管理十分有意义。Actuator是Spring Boot的一个附加功能,可以在应用程序生产环境时监视和管理应用程序。可以使用http的各种请求来监管、审计、收集应用的运行情况。2、AdminUI:底层使用的就是Actuator监控应用,实现可视化的界面;1、Actuator监控应用:没有界面,返回json格式;2、增加注解@EnableAdminServer。看到实例,然后点击实例既可以看到该应用的监控信息。2、直连模式增加配置。原创 2023-06-05 17:29:34 · 306 阅读 · 0 评论 -
springboot线程中获取bean
在线程中是无法直接使用Spring Beans,但是又需要使用Spring中的bean执行方法1:使用ApplicationContextAware在线程中直接获取bean创建ApplicationContextHandle类import org.springframework.beans.BeansException;import org.springframework.context.ApplicationContext;import org.springframework.conte原创 2020-08-21 13:03:19 · 1002 阅读 · 0 评论 -
RestTemplat
RestTemplate原创 2022-09-15 10:23:54 · 282 阅读 · 0 评论 -
springboot设置并获取启动参数
springboot原创 2022-08-30 10:51:01 · 6145 阅读 · 0 评论 -
springboot启动后和停止前执行方法
停止和启动原创 2022-08-29 19:53:15 · 4662 阅读 · 0 评论 -
springboot启动自动停止
springboot项目启动后自动停止,也引入了jar包<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId></dependency>但是启动仍然自动停止,怎么搞?在启动类上增加捕获异常并打印日志 public static void main(Strin原创 2022-04-21 17:20:52 · 4170 阅读 · 2 评论 -
返回数据JSON转换问题
主要是用来将返回的数据实体转换成json字符串,对转换的数据进行处理,本人处理Long转换的时候被坑到了,仅以记录import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;import com.fasterxml.jackson.datatype.jsr310.ser.Local原创 2022-04-11 16:30:01 · 601 阅读 · 0 评论 -
java后端传参数据校验
前端传数据到后端,后端需要对数据进行必要的数据校验,本人使用SpringBoot的validationpom文件引入包 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-validation</artifactId> </depende原创 2022-03-02 15:31:30 · 1495 阅读 · 0 评论