IntelliJ IDEA 2017版 spring-boot2.0.4的集成JSP

一、必须依赖四个包,其中三个是springboot自带包,可以不写版本号,有一个不在springboot中,需要设置版本号

 1  <!--引入Spring Boot内嵌的Tomcat对Jsp的解析包-->
 2         <dependency>
 3             <groupId>org.apache.tomcat.embed</groupId>
 4             <artifactId>tomcat-embed-jasper</artifactId>
 5         </dependency>
 6
 7         <!--servlet依赖的jar包start-->
 8         <dependency>
 9             <groupId>javax.servlet</groupId>
10             <artifactId>javax.servlet-api</artifactId>
11         </dependency>
12
13         <!--jsp依赖jar包start-->
14         <dependency>
15             <groupId>javax.servlet.jsp</groupId>
16             <artifactId>javax.servlet.jsp-api</artifactId>
17             <version>2.3.1</version>
18         </dependency>
19
20         <!--jstl标签依赖的jar包start-->
21         <dependency>
22             <groupId>javax.servlet</groupId>
23             <artifactId>jstl</artifactId>
24         </dependency>

二、通过Controller访问

三、查看源码

https://github.com/liushaoye/sprinboot-yml/tree/master

原文地址:https://www.cnblogs.com/liuyangfirst/p/9276230.html

时间: 2024-07-31 20:57:33

IntelliJ IDEA 2017版 spring-boot2.0.4的集成JSP的相关文章

IntelliJ IDEA 2017版 spring-boot 2.0.5 邮件发送简单实例 (三)

一.搭建SpringBoot项目 详见此文:https://www.cnblogs.com/liuyangfirst/p/8298588.html 注意: 需要添加mail依赖的包,同时还添加了lombock,方便日志打印.如图所示 二.启动Application,测试项目搭建是否成功 三.配置properties文档 1 #########邮箱协议 2 spring.mail.host=smtp.163.com ####还可以是smtp.126.com 等 3 ##########发送邮件的用

IntelliJ IDEA 2017版 spring-boot 2.0.3 邮件发送搭建,概念梳理 (一)

邮件发送功能总结        第一部分 背景 一.使用场景 (1)注册验证 注册各大网站,通常需要输入邮件地址,在注册成功后,会发送一封邮箱验证的邮件,点击确认,证明这个邮箱是用户自己的 (2)网站营销 公司运营做活动的时候,提前几天给用户发邮件,提醒老用户在活动时间参加活动. (3)安全的最后一道防线 一个网站好久不用的时候,会忘记密码,这个时候需要找回密码,很多种找回方式,最常用的找回方式就是通过邮箱找回密码. 首先,在网站输入邮箱,系统会根据注册的邮箱发送一封邮件,根据邮件中的地址,可以

Spring Boot2.0自定义配置文件使用

声明: spring boot 1.5 以后,ConfigurationProperties取消locations属性,因此采用PropertySource注解配合使用 根据Spring Boot2.0官方文档,PropertySource注解,只支持properties文件,因此排除 YAML配置 针对二,可考虑新建配置类,自行搜索,不再此次讨论范围 具体使用: 1.根目录下新建自定义配置文件夹与properties配置文件 example.name=tom example.wife=jerr

Spring Boot2.0之 监控管理

Spring boot监控中心: 针对微服务的服务状态,服务器的内存变化(内存.线程.日志管理等)检测服务配置连接地址是否有用(有些懒加载的情况下,用的时候发现卧槽不能用)模拟访问,懒加载.统计有多少个bean(Spring 容器中的bean).统计Spring MVC 中@RequestMapping(统计接口数) Actuator监控应用(无界面,返回json格式) AdminUi底层使用Actuator监控应用,实现可视化界面 Actuator是spring boot的一个附加功能,可帮助

IntelliJ IDEA 2017版 spring-boot2.0.4+mybatis+Redis处理高并发,穿透问题

一.当采用reddis缓存的时候,如果同时,一万次访问,那么就会有10000次访问数据库所以就会对数据库造成巨大压力,这时候,就要用到线程 1.方法体上加锁(优点,防护住了并发锁,缺点降低了内存效率) 1 /** 2 * 最简洁的高并发处理,但是,牺牲效率大 3 * 4 * @return 5 */ 6 public synchronized List<Student> selectAllStudent1() { 7 8 // 字符串序列化器 9 RedisSerializer redisSe

IntelliJ IDEA 2017版 spring-boot2.0.4+mybatis反向工程;mybatis+springboot逆向工程

一.搭建环境 采用IDE自动建立项目方式 然后,next next,配置导入依赖包 项目就生成了,在项目下导入配置文件GeneratorMapper.xml(项目结构如图所示) 配置文档,建立数据库和数据库连接 1 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE generatorConfiguration PUBLIC 2 "-//mybatis.org//DTD MyBatis Gen

IntelliJ IDEA 2017版 spring-boot2.0.2 搭建 JPA springboot DataSource JPA sort排序方法使用方式, 添加关联表的 order by

1.sort可以直接添加在命名格式的字段中 1 List<BomMain> findAllByDeleted(Integer deleted, Sort sort); 2.可以作为pageable的一个参数使用 1 Page<Originals> selectBomSeriesList(Pageable pageable); 向sort传参的方式 1.装入Pageable使用 1 Sort sort = new Sort(Sort.Direction.ASC, "seri

IntelliJ IDEA 2017版 spring-boot2.0.2 自动配置Condition

描述: 编译器修改参数      -Dfile.encoding=GBK     -Dstr.encoding=GBK Condition位置: 某一个类或注解存在的时候,装配,否则不装配 相关代码: https://github.com/liushaoye/quick_start/tree/third 原文地址:https://www.cnblogs.com/liuyangfirst/p/9069410.html

IntelliJ IDEA 2017版 spring-boot2.0.4的yml配置使用

一.必须配置字端两个 1 server: 2 port: 8080 3 servlet: 4 context-path: /demo 二.两种mvc转换springboot,一种是注解,一种就是.yml或properties配置 三.实际项目源码 https://github.com/liushaoye/sprinboot-yml/tree/master 原文地址:https://www.cnblogs.com/liuyangfirst/p/9276229.html