
spring相关
lemon_cake
这个作者很懒,什么都没留下…
展开
-
spring的@Configuration以及@ComponentScan
最近在学spring-boot,spring-boot配置少了很多,但是多了一些注解,但我对spring的注解了解的不多,查了一些学习中碰到的注解,下面是我参考博客的地址,按照他写的,自己去操作了一边,对spring有了更深入的了解参考博客:https://www.cnblogs.com/ilinuxer/p/6503161.html一、@Configuration的简单说明@...原创 2018-10-06 22:01:14 · 1325 阅读 · 0 评论 -
SpringBoot上传文件以及映射网络路径
一、前言:我这里的路径映射是指:将本地文件路径映射成网络URL地址,即通过URL可以访问到本地文件。之前文件上传之后,是在tomcat上来配置路径映射,但最近用的springboot,直接用nohup java -jar xxxx.jar &启动项目。貌似就无法在tomcat上配置了(可能可以通过配置tomcat插件来进行配置,不过我没试过)。环境:jdk1.8,sp...原创 2019-01-08 16:06:54 · 5832 阅读 · 0 评论 -
rabbitmq整合spring时报错:com.rabbitmq.client.ShutdownSignalException: connection error
错误详细信息如下:org.springframework.amqp.AmqpIOException: java.io.IOException org.springframework.amqp.rabbit.support.RabbitExceptionTranslator.convertRabbitAccessException(RabbitExceptionTranslator.java...原创 2018-11-08 20:02:10 · 6596 阅读 · 1 评论 -
spring配置JUnit环境
pom.xml<!-- JUNIT测试架包 --><dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> <scope&原创 2017-10-09 19:28:49 · 1604 阅读 · 0 评论 -
spring-boot的application.yml配置文件,学习(二)
上一篇路径:https://blog.youkuaiyun.com/h996666/article/details/82958848前言 springboot有两种格式的文件,一种是常用的properties,另一种是yml,我下面说的是yml格式的。这两种格式的配置文件本质上是一样的,写法不同,springboot貌似更推荐yml格式。一、spring-boot的yml文件简单配...原创 2018-10-09 18:20:33 · 513 阅读 · 0 评论 -
创建spring-boot项目,学习(一)
一、用IDEA创建spring-boot工程IDEA版本:2018.1.5的Ultimate版本,非Ultimate版本可能缺少一些功能。下面开始创建spring-boot项目1,选择Spring-Initializer,之后next2,填写项目名称,项目所属,包名3,选择项目类型,选择spring-boot版本4,项目存放路径5,完成创建,目录如下:...原创 2018-10-09 12:00:11 · 268 阅读 · 0 评论 -
使用Maven搭建springmvc项目(一)
用maven搭建springmvc项目我断断续续的搞了好几天。踩了不少坑。今天终于调通了。特此记录一下。下面是我的项目结构目录。pom.xml配置<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:sche...原创 2017-09-21 16:23:18 · 335 阅读 · 0 评论 -
使用Maven搭建springmvc项目(二)
使用Maven搭建springmvc项目(一),这篇只有springmvc的配置。下面是+mybatis的配置。先上项目结构图:下面是配置文件:pom.xml<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"...原创 2017-09-22 10:05:18 · 223 阅读 · 0 评论 -
springmvc整合redis
参考的博客:http://www.cnblogs.com/fengzheng/p/5941953.html看之前,建议先花点时间去看下jedis的使用。项目目录如下:依赖的架包(pom.xml配置): <!-- spring redis --><dependency> <groupId>org.springframework...转载 2017-09-28 15:37:26 · 1599 阅读 · 0 评论 -
往数据库里插入时间数据时,时间自动减少了14h
问题描述:使用springmvc作为框架,往数据库里插入(更新)数据时,发现时间格式的数据自动减少了14小时。比如:我INSERT INTO test_table (id, name, birthday) VALUES(1, 'chen', '2017-12-12 15:00:00')通过代码插入到数据库后,发现birthday字段的时间并不是'2017-12-12 15:00:00'...原创 2017-12-12 16:02:53 · 3265 阅读 · 0 评论 -
mybatis找不到接口实现
碰到一个比较清奇的问题:Junit测试整个流程能走通,但是整个项目一运行,调用接口之后就报错,报绑定接口失败。错误信息:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 造成的原因是:我xml的路径命名错了,把resources写成了resource,少写了个s。但为什么J...原创 2018-04-23 16:23:59 · 1737 阅读 · 0 评论 -
springboot下载文件
一、直接贴代码:import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RestController;import javax.servlet.http.HttpServletRequest;import javax.ser...原创 2019-02-14 16:13:33 · 656 阅读 · 2 评论