商城首页欢迎来到中国正版软件门户

最新文章

  • SpringBoot怎么实现读取YML,yaml,properties文件 正版软件
    SpringBoot怎么实现读取YML,yaml,properties文件
    yml,yaml,properties三种文件都是用来存放配置的文件,一些静态数据,配置的数据都会存放到里边。但是有的时候我们不仅仅需要存储静态数据,还需要从文件中读取数据出来。这三种文件都放在项目--》src--》main--》resource下边。如果resource里边需要存放其他文件的话,会在resource里边创建一个config包。将配置文件存放其中。1.在项目中新建配置文件,文件存放地址bootstrap.yml是SpringBoot程序的一个配置文件,在项目启动前就会被加载,将数据加载后,
    1084天前 Properties yml SpringBoot 0
  • 基于SpringBoot怎么应用ApplicationEvent 正版软件
    基于SpringBoot怎么应用ApplicationEvent
    一、案例场景1.发起restful请求,根据请求参数发布不同的事件。2.事件监听者,监听到事件后,做预定操作。3.本例是事件同步处理机制,即发布事件后,会同步监听事件。二、使用类org.springframework.context.ApplicationEvent,spring的事件对象。org.springframework.context.ApplicationListener,事件监听者接口。org.springframework.context.ApplicationEventPublisher
    1084天前 SpringBoot applicationevent 0
  • mysql中json怎么使用 正版软件
    mysql中json怎么使用
    mysql字段的数据类型支持json格式,可以直接存储json数组和json对象。一、插入json数据的方式有两种1、以普通字符串形式插入,需要遵循json格式2、用内置函数(JSON_OBJECT和JSON_ARRAY)创建JSON数据再插入二、查询JSON中字段的数据1、column->'path'和JSON_EXTRACT(column,'path')形式访问指定字段的具体数据。(*注意path外面都要用单引号包起来)其中column表示要查询的数据字段列名;path
    1084天前 MySQL JSON 0
  • Springboot如何实现邮件任务 正版软件
    Springboot如何实现邮件任务
    邮件任务pom.xmlorg.springframework.bootspring-boot-starter-mailtest配置文件spring:mail:username:***********password:*********(这是qq邮箱的授权码)host:smtp.qq.comspring.mail.properties.mail.smtp.ssl.enable=true测试类@Autowired(required=false)JavaMailSenderImplmailSender;@Tes
    1084天前 SpringBoot 0
  • Springboot2.6.x高版本与Swagger2版本冲突问题怎么解决 正版软件
    Springboot2.6.x高版本与Swagger2版本冲突问题怎么解决
    问题:SpringBoot2.6.x版本引入依赖springfox-boot-starter(Swagger3.0)后,启动容器会报错:Failedtostartbean‘documentationPluginsBootstrapper‘;nestedexception…原因Springfox假设SpringMVC的路径匹配策略是ant-path-matcher,而SpringBoot2.6.x版本的默认匹配策略是path-pattern-matcher,这就造成了上
    1084天前 SpringBoot swagger2 0
  • Spring Boot如何防止接口恶意刷新和暴力请求 正版软件
    Spring Boot如何防止接口恶意刷新和暴力请求
    首先创建一个自定义的拦截器类,也是最核心的代码;/***@package:com.technicalinterest.group.interceptor*@className:IpUrlLimitInterceptor*@description:ip+url重复请求现在拦截器*@author:Shuyu.Wang*@date:2019-10-1212:34*@since:0.1**/@Slf4jpublicclassIpUrlLimitInterceptorimplementsHandlerInterce
    1084天前 SpringBoot 0
  • SpringBoot怎么整合SpringSecurityOauth2实现鉴权动态权限问题 正版软件
    SpringBoot怎么整合SpringSecurityOauth2实现鉴权动态权限问题
    准备spring-boot:2.1.4.RELEASEspring-security-oauth3:2.3.3.RELEASE(如果要使用源码,不要随意改动这个版本号,因为2.4往上的写法不一样了)mysql:5.7效果展示这边只用了postman做测试,暂时未使用前端页面来对接,下个版本角色菜单权限分配的会有页面的展示1、访问开放接口http://localhost:7000/open/hello2、不带token访问受保护接口http://localhost:7000/admin/user/info3
    1084天前 Spring SpringBoot security 0
  • springboot解决CORS跨域的方式有哪些 正版软件
    springboot解决CORS跨域的方式有哪些
    一、实现WebMvcConfigurer接口@ConfigurationpublicclassWebConfigimplementsWebMvcConfigurer{/***添加跨域支持*/@OverridepublicvoidaddCorsMappings(CorsRegistryregistry){//允许跨域访问的路径'/**'表示应用的所有方法registry.addMapping("/**")//允许跨域访问的来源'*'表示所有域名来源.allowedOrigin
    1084天前 SpringBoot cors 0
  • SpringBoot整合Retry如何实现错误重试 正版软件
    SpringBoot整合Retry如何实现错误重试
    引入依赖org.springframework.bootspring-boot-starter-aoporg.springframework.retryspring-retry完整依赖pom.xml4.0.0org.springframework.bootspring-boot-starter-parent2.7.7com.exampledemo0.0.1-SNAPSHOTdemoDemoprojectforSpringBoot1.8org.springframework.bootspring-boot-
    1084天前 SpringBoot retry 0
  • Springboot如何整合JwtHelper实现非对称加密 正版软件
    Springboot如何整合JwtHelper实现非对称加密
    一、生成公私钥对提供两种方法,一种基于命令行中的Keytool工具生成,一种是基于SpringSecurity中的KeyPairGenerator类生成,现实现第二种方式://加密算法privatestaticfinalStringKEY_ALGORITHM="RSA";//公钥keyprivatestaticfinalStringPUB_KEY="publicKey";//私钥keyprivatestaticfinalStringPRI_KEY="privateKey";publicstaticMapg
    1084天前 SpringBoot jwthelper 0