随笔分类 -  spring

spring的一些小demo
摘要:原文:https://mp.weixin.qq.com/s/Hz0gStUXe40FNiuY7rudhA 一种简单办法是,新代码先用其他端口启动,启动完毕后,更改nginx的转发地址,nginx重启非常快,这样就避免了大量的用户访问失败,最后终止老进程就可以。 新思路: 判断端口是否占用 占用则先通 阅读全文
posted @ 2024-08-12 12:21 wujf 阅读(22) 评论(0) 推荐(0) 编辑
摘要:package com.xf.config; import java.sql.Connection; import java.util.Properties; import org.apache.ibatis.executor.statement.StatementHandler; import o 阅读全文
posted @ 2024-08-12 12:20 wujf 阅读(65) 评论(0) 推荐(0) 编辑
摘要:@Bean public CorsFilter corsFilter() { CorsConfiguration config = new CorsConfiguration(); config.addAllowedOriginPattern("*"); config.setAllowCredent 阅读全文
posted @ 2023-10-11 16:24 wujf 阅读(16) 评论(0) 推荐(0) 编辑
摘要:1、pom <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 阅读全文
posted @ 2023-05-26 17:06 wujf 阅读(1000) 评论(0) 推荐(0) 编辑
摘要:背景 在后端日常开发中总会有各种各样的导出需求,实现这个需求必须要解决的两个问题: 1、表头不能直接使用字段名,需要显示为中文,甚至还需要考虑国际化 2、值需要翻译,比如性别、状态之类的字段 现状 现在主流写的比较好的方法是定义一个对象,对象上用自定义的注解+easytrans 我的解决方案 定义要 阅读全文
posted @ 2023-05-22 12:06 wujf 阅读(376) 评论(0) 推荐(1) 编辑
摘要:package com.xf.config; import com.alibaba.druid.sql.ast.statement.SQLExprTableSource; import com.alibaba.druid.sql.dialect.mysql.visitor.MySqlASTVisit 阅读全文
posted @ 2023-02-22 17:02 wujf 阅读(147) 评论(0) 推荐(0) 编辑
摘要:package com.ruoyi.framework.config; import com.baomidou.mybatisplus.core.plugins.InterceptorIgnoreHelper; import com.baomidou.mybatisplus.core.toolkit 阅读全文
posted @ 2023-02-20 12:17 wujf 阅读(156) 评论(0) 推荐(0) 编辑
摘要:@PostConstruct对于注入到Spring容器中的类,在其成员函数前添加@PostConstruct注解,则在执行Spring beans初始化时,就会执行该函数。但由于该函数执行时,其他Spring beans可能并未初始化完成,因此在该函数中执行的初始化操作应当不依赖于其他Spring 阅读全文
posted @ 2021-11-20 12:30 wujf 阅读(3489) 评论(0) 推荐(0) 编辑
摘要:package com.pj.project4sp; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import com. 阅读全文
posted @ 2021-11-04 11:10 wujf 阅读(61) 评论(0) 推荐(0) 编辑
摘要:引入依赖 <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-core</artifactId> </dependency> 测试 @Test public void pas 阅读全文
posted @ 2021-09-17 17:37 wujf 阅读(720) 评论(0) 推荐(0) 编辑
摘要:Map headmap = new LinkedHashMap<String, String>(); headmap.put("createtime", "日期"); headmap.put("orderno", "案件号"); headmap.put("vin", "vin码"); headmap 阅读全文
posted @ 2021-07-28 09:33 wujf 阅读(125) 评论(0) 推荐(0) 编辑
摘要:jvm参数方式: -javaagent:D:/codesoft/elastic-apm-agent-1.18.0.jar -Delastic.apm.service_name=my-application -Delastic.apm.server_urls=http://localhost:8200 阅读全文
posted @ 2020-09-28 11:36 wujf 阅读(1565) 评论(0) 推荐(0) 编辑
摘要:package study; import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.security.KeyFactory; import java.security.KeyP 阅读全文
posted @ 2020-07-08 11:11 wujf 阅读(443) 评论(0) 推荐(0) 编辑
摘要:http://blog.itpub.net/31545684/viewspace-2215300/ spring cloud eureka 参数配置 https://www.jianshu.com/p/e2bebfb0d075 阅读全文
posted @ 2019-06-05 16:58 wujf 阅读(855) 评论(0) 推荐(0) 编辑
摘要:@Bean public SqlSessionFactory sqlSessionFactory(DataSource dataSource) throws Exception { SqlSessionFactoryBean fb = new SqlSessionFactoryBean(); fb.setDataSource(dataSource)... 阅读全文
posted @ 2018-11-27 17:28 wujf 阅读(782) 评论(0) 推荐(0) 编辑
摘要:Starting from Spring Boot 2.0 -web(false)/setWebEnvironment(false) is deprecated and instead Web-Application-Type can be used to specify 阅读全文
posted @ 2018-08-11 10:28 wujf 阅读(6578) 评论(0) 推荐(1) 编辑
摘要:package autowired; import java.beans.Introspector; import java.beans.PropertyDescriptor; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.ArrayList; import java.util... 阅读全文
posted @ 2018-06-12 15:47 wujf 阅读(952) 评论(0) 推荐(0) 编辑
摘要:package com.qmtt.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.redis.connection.Message; im... 阅读全文
posted @ 2018-02-26 16:27 wujf 阅读(233) 评论(0) 推荐(0) 编辑
摘要:package com.qmtt.tools; import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org... 阅读全文
posted @ 2018-01-30 17:15 wujf 阅读(516) 评论(0) 推荐(0) 编辑
摘要:在网上找的demo写了一个小例子,本地开发测试都很正常,但是部署在tomcat就各种坑 1、MyWebSocket不要用spring 注解标注 2、main方法对应的类继承SpringBootServletInitializer,重写configure 阅读全文
posted @ 2018-01-16 14:34 wujf 阅读(604) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示