springboot-shiro chapter02——springboot webmvc jsp
简介:这一节主要涉及spring boot 支持jsp, 由于对spring boot不太熟悉,走了一些弯路。
环境:
IDEA15+
JDK1.8+
Maven3+
代码:
https://git.oschina.net/xinshu/springboot-shiro
一、pom.xml资源依赖
相对于chapter01,这里依赖的资源相对多些。没有像chapter01中直接的引用spring-webmvc、spring-boot-starter和spring-boot-tomcat,而是通过引用spring-boot-starter-web资源。
可以看出spring-boot-starter-web包含了chapter01的资源,同时为了解析jsp资源需要引入jsaper, 将jsp文件预编译成java文件,然后编译成class文件。此时jvm才可以加载jsp相应的class文件
另外,jstl(jsp standard tag library)资源主要是JSP标准标签库,提高jsp开发效率

注:这里通过<parent>节点间接的依赖spring-boot-starter-parent, 否则在编译时会有编译异常的问题
二、springboot配置
这里主要设置springmvc视图解析器相关的属性
spring.mvc.view.prefix: /WEB-INF/jsp/
spring.mvc.view.suffix: .jsp
而startclass与chapter01有所不同,这里继承了SpringBootServletInitializer主要是通过继承此类将应用部署到servlet容器中
@SpringBootApplication
@ComponentScan(value="com.shujushow")
public class Chapter02Application extends SpringBootServletInitializer { @Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application){ return application.sources(Chapter02Application.class);
} public static void main(String[] args) throws Exception{
SpringApplication.run(Chapter02Application.class, args);
}
}
springboot-shiro chapter02——springboot webmvc jsp的更多相关文章
- springboot + shiro + cas4.2.7 实战
1. 下载地址 https://github.com/apereo/cas/archive/v4.2.7.zip 2. 解压后, 用intellj idea 打开 3. 执行 gradle build ...
- springboot+shiro
作者:纯洁的微笑 出处:http://www.ityouknow.com/ 这篇文章我们来学习如何使用Spring Boot集成Apache Shiro.安全应该是互联网公司的一道生命线,几乎任何的公 ...
- Spring Cloud之路:(七)SpringBoot+Shiro实现登录认证和权限管理
版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/sage_wang/article/details/79592269一.Shiro介绍1.Shiro是 ...
- (转)Springboot+shiro配置笔记+错误小结
springboot不像springmvc,它没有xml配置文件,那该如何配置shiro呢,其实也不难,用java代码+注解来解决这个问题.仅以此篇记录我对shiro的学习,如有对过客造成不便,实在抱 ...
- Springboot+shiro配置笔记+错误小结
软件152 尹以操 springboot不像springmvc,它没有xml配置文件,那该如何配置shiro呢,其实也不难,用java代码+注解来解决这个问题.仅以此篇记录我对shiro的学习,如有对 ...
- 18.Shiro与Springboot整合下登陆验证UserService未注入的问题
Shiro与Springboot整合下登陆验证UserService未注入的问题 前言: 刚开始整合的情况下,UserService一执行,就会报空指针异常. 看了网上各位大神的讲解,什么不能用ser ...
- Springboot+shiro配置笔记+错误小结(转)
软件152 尹以操 springboot不像springmvc,它没有xml配置文件,那该如何配置shiro呢,其实也不难,用java代码+注解来解决这个问题.仅以此篇记录我对shiro的学习,如有对 ...
- springboot shiro 基本整合
springboot shiro 基本整合 https://www.w3cschool.cn/shiro/c52r1iff.html http://shiro.apache.org/configura ...
- SpringBoot+Shiro学习(七):Filter过滤器管理
SpringBoot+Shiro学习(七):Filter过滤器管理 Hiwayz 关注 0.5 2018.09.06 19:09* 字数 1070 阅读 5922评论 1喜欢 20 先从我们写的一个 ...
- SpringBoot+Shiro (一)
从网上搜索SpringBoot+Shiro相关文章,大部分都需要DB和Ecache的支持.这里提供一个最简单的Spring+Shiro的配置. 前言: 1. 由于SpringBoot官方已经不再建议使 ...
随机推荐
- How to input the newline in Numbers of Mac?
newline control+enter
- oracle 未明确定义错误
select sysuser1.* from (select sysuser2.*, rownum rownum_temp from (select yycgdmx.id yycgdmxid, -- ...
- iOS实现下拉放大的功能
#import "HMViewController.h" ; @interface HMViewController () @property (nonatomic, weak) ...
- PCA最小平方误差理论推导
PCA最小平方误差理论推导 PCA求解其实是寻找最佳投影方向,即多个方向的标准正交基构成一个超平面. 理论思想:在高维空间中,我们实际上是要找到一个d维超平面,使得数据点到这个超平面的距离平方和最小 ...
- JSON和JSONP简单总结
jsonp和json的区别,原理,在jquery中的使用 http://www.cnblogs.com/dowinning/archive/2012/04/19/json-jsonp-jquery.h ...
- hdfs会出现的一些问题
实训的第一篇博客献给坑了我的hdfs…… 由于电脑的原因,突然花屏,虚拟机来不及挂起.之后发现50070端口进不去,查看jps进程发现没有namenode 先用stop-all.sh命令再start还 ...
- VC中键盘键的对应关系
转载:VC中如何响应键盘和鼠标事件 VC 中用 KeyPress 表示键盘响应的所有事件,包括 OnKeyDown 事件(键按下). OnKeyUp 事件(键按下后弹起)和 OnKeyPress 事件 ...
- 《DSP using MATLAB》示例Example 9.5
代码: %% ------------------------------------------------------------------------ %% Output Info about ...
- 《DSP using MATLAB》示例Example7.25
今天清明放假的第二天,早晨出去吃饭时天气有些阴,十点多开始“清明时节雨纷纷”了. 母亲远在他乡看孙子,挺劳累的.父亲照顾生病的爷爷…… 我打算今天把<DSP using MATLAB>第7 ...
- codechef Far Graphs
codechef Far Graphs https://www.codechef.com/problems/TBGRAPH 题意 : 给一个简单无向图,要求构造一个序列\(a\),长度为\(n\),极 ...