正文
spring boot 学习笔记(二) 构建web支持jsp
小程序:扫一扫查出行
【扫一扫了解最新限行尾号】
复制小程序
【扫一扫了解最新限行尾号】
复制小程序
一、必须将项目打包成 war包
<packaging>war</packaging> |
二、pom.xml加入依赖包
<dependency> <!--jsp支持--> |
三、application.properties
spring.mvc.view.prefix=/WEB-INF/jsps/ spring.thymeleaf.cache=false //这个是关闭thymeleaf缓存 |
四、在项目中src/main/下建立 webapp/WEB-INF/jsps/
五、controller
@Controller @RequestMapping("jsps") |
六、访问 http://localhost:8080/jsps ok。