摘要:
Spring boot 集成 Redis 的步骤如下: 1、在pom.xml中配置相关的jar依赖: 2、在Springboot核心配置文件application.properties中配置redis连接信息: 3、 配置了上面的步骤,Spring boot将自动配置RedisTemplate,在需 阅读全文
posted @ 2019-10-29 23:38
tunan96
阅读(139)
评论(0)
推荐(0)
摘要:
在实际开发中,我们修改某些代码逻辑功能或页面都需要重启应用,这无形中降低了开发效率; 热部署是指当我们修改代码后,服务能自动重启加载新修改的内容,这样大大提高了我们开发的效率; Spring boot热部署通过添加一个插件实现; 插件为:spring-boot-devtools,在Maven中配置如 阅读全文
posted @ 2019-10-29 23:32
tunan96
阅读(206)
评论(0)
推荐(0)
摘要:
认识 RESTFull 什么是RESTFull? RESTFull 一种互联网软件架构设计的风格,但它并不是标准,它只是提出了一组客户端和服务器交互时的架构理念和设计原则,基于这种理念和原则设计的接口可以更简洁,更有层次; 任何的技术都可以实现这种理念; REST这个词,是Roy Thomas Fi 阅读全文
posted @ 2019-10-29 23:31
tunan96
阅读(396)
评论(0)
推荐(0)
摘要:
Spring boot 集成 MyBatis的步骤如下: 1、在pom.xml中配置相关jar依赖 2、在Springboot的核心配置文件 application.properties 中配置MyBatis的Mapper.xml文件所在位置: # mybatis 别名扫描mybatis.type- 阅读全文
posted @ 2019-10-29 23:27
tunan96
阅读(3312)
评论(0)
推荐(0)
摘要:
Spring Boot 使用事务非常简单; 1、 在入口类中使用注解 @EnableTransactionManagement 开启事务支持; 2、在访问数据库的Service实现类的方法上添加注解 @Transactional 即可; 控制器添加方法 service接口和实现类分别添加方法 访问发 阅读全文
posted @ 2019-10-29 23:27
tunan96
阅读(93)
评论(0)
推荐(0)
摘要:
在Spring boot中使用jsp,按如下步骤进行: 1、在pom.xml文件中配置依赖项 2、在application.properties文件配置spring mvc的视图展示为jsp: 3、在src/main 下创建一个webapp目录,然后在该目录下新建index.jsp页面,pom.xm 阅读全文
posted @ 2019-10-29 23:24
tunan96
阅读(206)
评论(0)
推荐(0)
摘要:
Spring boot下的Spring mvc 和之前的Spring mvc使用是完全一样的: @Controller 即为Spring mvc的注解,处理http请求; @RestController Spring4后新增注解; 是@Controller与@ResponseBody的组合注解; 用 阅读全文
posted @ 2019-10-29 23:22
tunan96
阅读(75)
评论(0)
推荐(0)
摘要:
我们可以在Spring boot的核心配置文件中自定义配置,然后采用如下注解去读取配置的属性值; 1、@Value注解,用于逐个读取自定义的配置,比如: 在配置文件中添加 在类中使用该配置 如果出现乱码,设置编辑器 2、@ConfigurationProperties注解,将配置文件中的配置参数读取 阅读全文
posted @ 2019-10-29 23:18
tunan96
阅读(167)
评论(0)
推荐(0)
摘要:
Spring boot的核心配置文件用于配置Spring boot程序,有两种格式的配置文件: 1、.properties文件 键值对的properties属性文件配置方式 2、.yml文件 yml 是一种 yaml 格式的配置文件,主要采用一定的空格、换行等格式排版进行配置; yaml 是一种直观 阅读全文
posted @ 2019-10-29 23:17
tunan96
阅读(375)
评论(0)
推荐(0)
摘要:
快速开发一个Spring boot程序步骤如下: 1、创建一个Spring boot项目; 1、可以采用方式一: 使用 eclipse 的 Spring Tool Suite (STS) 插件/或者 IDEA 自带的插件创建; 2、可以采用方式二:直接使用 Maven 创建项目的方式创建; STS创 阅读全文
posted @ 2019-10-29 23:15
tunan96
阅读(200)
评论(0)
推荐(0)
摘要:
Spring boot 简介 1、Spring boot是Spring家族中的一个全新的框架,它用来简化Spring应用程序的创建和开发过程,也可以说Spring boot能简化我们之前采用Spring mvc + Spring + MyBatis 框架进行开发的过程; 2、在以往我们采用 Spri 阅读全文
posted @ 2019-10-29 23:03
tunan96
阅读(112)
评论(0)
推荐(0)

浙公网安备 33010602011771号