#SpringBoo

springboot项目中使用spring-data-Redis对map序列化时报错

错误信息:java.lang.ClassCastException:java.lang.Integercannotbecasttojava.lang.Stringatorg.springframework.data.redis.serializer.StringRedisSerializer.serialize(Str...

SpringBoot中日志配置

由于一些框架中还使用log4j-1.x系列陈旧的日志框架,调试过程中有一些错误信息不能在控制台显示,增加了调试成本。以下配置方法将帮助你获得log4j-1.x日志在控制台显示。解决方法:使用logback充当门面模式,由他来适配底层日志框架。logback-spring.xml(一定要用着名称)<?xmlvers...
代码星球 代码星球·2020-04-17

JAVA8中接口的一些新用法(springboot环境)

@ConfigurationpublicinterfaceIAbstractConvertStrategy{CacheServicegetCacheService();defaultbooleanexistedMedia(Stringuuid){//重复的解析请求,丢弃returngetCacheService().h...

Asynchronous Streaming Request Processing in Spring MVC 4.2 + Spring Boot(SpringBoot中处理异步流请求 SpringMvc4.2以上)

WiththereleaseofSpring4.2version,ThreenewclasseshavebeenintroducedtohandleRequestsAsynchronouslyoftheServletThread.Whichare;ResponseBodyEmitterSseEmitterStreami...

springboot下jar包方式运行Caused by: java.lang.ExceptionInInitializerError: null

idea调试过程中不会出现此问题,异常如下org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'apiNotificationController'definedinURL[jar:file:/E:/aipla...

springboot配置虚拟路径访问用户上传的附件及图片资源

在springmvc项目中,我们通常把图片及附件存放到WEB-INF/upload类似的路径。springboot项目是通过jar包方式运行的。笔者曾尝试以下代码,把图片转成base64格式的图片。importlombok.extern.slf4j.Slf4j;importsun.misc.BASE64Decoder;...

SpringBoot集成tk mybatis插入数据,回显主键为null

实体信息如下@DatapublicclassApiCertificate{@Id@GeneratedValue(generator="JDBC")privateIntegerid;privateStringurl;}插入方法在saveCertificate中,返回结果如下:   最终发现原...

使用MockMvc进行springboot调试(SpringbootTest)

测试前关闭web项目。springboot启动程序WebApplication.class笔者本地自定了端口SpringBootTest.WebEnvironment.DEFINED_PORT代码如下:importcom.xxx.web.WebApplication;importorg.junit.Before;imp...

springboot拦截json后缀的请求,返回json数据

需求:请求list.json返回以下数据{"jsonResult":{"code":200,"message":"查询成功","nextUrl":null,"data":[{"pageNo":0,"id":1,"type":"personal","avatarUrl":null,"source":null,"login...

springboot Thymeleaf中格式化jsr310新日期时间类(LocalDateTime,LocalDate)--thymeleaf格式化LocalDateTime,LocalDate等JDK8新时间类

依赖maven包<dependency><groupId>org.thymeleaf.extras</groupId><artifactId>thymeleaf-extras-java8time</artifactId></dependency>&...

springboot整合websocket后运行测试类报错:javax.websocket.server.ServerContainer not available

转载自:https://blog.csdn.net/fggdgh/article/details/87185555springboot项目添加websocket依赖后运行测试类报如下错误:org.springframework.beans.factory.BeanCreationException:Errorcreat...

SpringBoot 2.x中为tomcat配置ssl(https)支持

参考来源:https://www.cnblogs.com/imfjj/p/9058443.htmlhttps://blog.csdn.net/jackymvc/article/details/81077885配置证书:keytool-genkeypair-aliastomcat-keyalgRSA-keystoreto...

将springboot安装成windows服务启动。

下载WindowsServiceWrapper  本文下载了winsw-2.3.0-bin.exe。新建一个目录aiplatformService在目录里面新建一个aiplatformService.xml,同时把winsw-2.3.0-bin.exe重命名陈aiplatformService.ex...

SpringMVC,SpringBoot上传文件简洁代码

@RequestMapping("/updateAvatar.html")publicStringupdateHeadUrl(MultipartFileavatar,Modelmodel,HttpSessionsession)throwsIOException{//文件类型限制String[]allowedType={...

Springboot测试类之@RunWith注解

@runWith注解作用:--@RunWith就是一个运行器--@RunWith(JUnit4.class)就是指用JUnit4来运行--@RunWith(SpringJUnit4ClassRunner.class),让测试运行于Spring测试环境,以便在测试开始的时候自动创建Spring的应用上下文--@RunWi...
首页上一页...3940414243...下一页尾页