• 首页
  • Java
  • 新建的springboot项目接口返回乱码的解决方法

    application.properties配置文件加如下配置:server.servlet.encoding.force=true,server.servlet.encoding.charset=UTF-8,server.servlet.encoding.enabled=true

    2025.03.19
  • 配置@ConfigurationProperties后读取yml文件的参数值为null的最大可能原因

    在Springboot项目中,配置@ConfigurationProperties后读取yml文件的参数值为null。解决:get前是static标识,set直接是void方法,这样写才是正确的。

    2023.08.08
  • Caused by: java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11FontManager

    方法一:找到tomcat下的bin/catalina.sh中JAVA_OPTS,在后面添加 -Djava.awt.headless=true即可。方法二:yum install -y libgcc.i686 --setopt=protected_multilib=false

    2023.08.02
  • springboot加入SSL证书设置https访问

    在application.properties中加入如下配置:server.port=443,server.ssl.key-store= classpath:www.xxx.cn.jks,server.ssl.key-store-password=xxxxxx,server.ssl.keyStoreType=JKS

    2023.05.19
  • Springboot用pagehelper分页插件查询Oracle的速度比较慢的解决办法

    设置pagehelper.helperDialect=oracle9i,会改变PAGEHELPER_ROW_ID的位置,来提供查询速度。

    2023.05.17
  • shiro的登录账号密码校验过程,SimpleAuthenticationInfo的参数定义

    SimpleAuthenticationInfo的参数解释:第一个参数:可以传username登录名,也可传user对象,后面SecurityUtils.getSubject().getPrincipal();这个方法会把这个值取出来。需要取用户名还是整个用户对象,你这个参数传什么那里就取什么。

    2023.05.11
  • Shiro控制没有登录时,返回指定JSON格式数据

    新增ShiroUserFilter 文件, extends UserFilter,ShiroFilterFactoryBean新增.setFilters(filters);

    2023.05.10
  • SpringBoot中mybatis返回的Date时间格式化

    application文件中新增spring.jackson.date-format=yyyy-MM-dd HH:mm:ss

    2023.05.09
  • ClassNotFoundException: org.aspectj.lang.annotation.Pointcut

    ClassNotFoundException: org.aspectj.lang.annotation.Pointcut。解决方法:pom.xml中新加spring aop的依耐即可

    2023.05.06
  • org.apache.shiro.UnavailableSecurityManagerException: No SecurityManager

    加载不到SecurityManager ,但是你又写了ShiroConfig,并加了@Configuration注解,还是出问题,那么问题可能出现在@SpringBootApplication上没扫码你的ShiroConfig文件。解决办法:@SpringBootApplication上加scanBasePackages配置

    2023.05.05
  • SpringBoot新增配置Mybatis

    pom中新增<artifactId>mybatis-spring-boot-starter</artifactId>,application.properties文件中配置Mybatis连接信息:mybatis.type-aliases-package=com.example.demo

    2023.04.26
  • Springboot2通过thymeleaf给js、css、jpg、png等静态文件加版本号控制

    registry.addResourceHandler("/**").addResourceLocations("classpath:/static/").resourceChain(false).addResolver(new VersionResourceResolver().addContentVersionStrategy("/**"));

    2023.04.14
  • 比synchronized更好用的锁(Lock)

    Lock不是Java语言内置的,synchronized是Java语言的关键字,因此是内置特性。

    2023.04.13
  • mybatis的xml中查单表和单表关联表的查询对比

    下面给大家两张图,对比mybatis关联查询和普通单表查询的区别,一眼就可以看出关联表查询的写法。

    2023.03.22
  • 新建springboot项目,springboot启动就结束,springboot的pom.xml第一行报错

    导入项目的时候,pom.xml的第一行报错,解决办法,在properties中加入maven-jar-plugin.version的版本;在启动这个springboot项目时,启动完就结束了。解决办法,在pom.xml中新增spring-boot-starter-web模块;

    2023.03.04
  • « 上一页
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 下一页 »
  • 当前 / 条,共 92 条