![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
spring
年年有很多余
这个作者很懒,什么都没留下…
展开
-
SpringBoot整合Thymeleaf后无法引入js 和 css
解决方法1: 实现WebMvcConfigurer 的addResourceHandlers 方法添加映射解决方法2: 修改pom文件 (大家可以看编译后的结果目录) ,我的css 和 js 都是没有放在classpath:templates目录下的,都是放在webapp下的 <resource> <directory>src/main/webapp</directory> &.原创 2021-11-10 18:44:54 · 1211 阅读 · 0 评论 -
Spring的AOP常用的几个切入方式
@annotation():任何标注了指定注解的目标方法链接点 @execution():满足匹配模式字符串的所有目标类方法的连接点 @args():目标类方法参数中是否有指定特定注解的连接点 @within():匹配目标对象拥有指定注解的类的所有方法target():this() :args更加详细的可以看:Spring AOP的使用...原创 2021-05-08 07:11:30 · 885 阅读 · 0 评论 -
Spring的Bean的生命周期
输出顺序: 这是类的构造函数 这是初始化功能 @PostConstruct! 这是初始化方法:InitializingBean.afterPropertiesSet 这是初始化功能 InitMethod ! 这是销毁方法: @PreDestroy 这是销毁方法:DisposableBean.destroy 这是销毁方法:destroyMethod初始化过程: 构造函数 > @PostConstruct > Initializin.原创 2021-05-07 17:18:07 · 92 阅读 · 0 评论 -
WebSocket 实现类似Linux中tail 命令的文件追加监控
环境; SpringMVC + WebSocket实现方式: 通过RandomAccessFile实现对文件的监控public class FileTailWatcherRun implements Runnable { /** * 缓存近10条 */ private final LimitQueue<String> limitQueue = new LimitQueue<>(100); private Rando...原创 2021-04-09 16:08:55 · 182 阅读 · 0 评论 -
Spring集成WebSocket
SpringBoot 集成 WebSocketSpringMVC 集成 WebSocket1. SpringBoot 集成 WebSocket配置类import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;import org.springframework.web.socket.server.standard.Serv..原创 2021-04-07 14:00:47 · 573 阅读 · 3 评论 -
SpringMVC请求转发时同时支持.jsp和.html
我的写法是根据springboot受的启发<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name = "prefix" value="/"></property> ...原创 2019-07-21 16:15:08 · 764 阅读 · 0 评论 -
spring通过AbstractRouteDataSource 配置动态数据源
1.通过Bean.xml配置数据库的配置文件 DynamicDataSource.propertiesUser=rootPassword=roottest.Url=jdbc:mysql://localhost:3306/testDriver=com.mysql.jdbc.Driverhotel.Url=jdbc:mysql://localhost:3306/hotel...原创 2019-07-17 15:37:20 · 2012 阅读 · 0 评论 -
谈canvas转图片的方法(base64编码)
上代码:这首先的是前端代码<canvas width="400" height="400" style="margin:50px auto;border: 1px solid #ccc;"> 你的浏览器不支持Canvas </canvas> <span style="cursor:pointer;">点击下载</span> <...原创 2019-03-19 10:02:10 · 9461 阅读 · 0 评论