摘要: 大纲 (1) 创建Maven web project; (2) 在pom.xml文件添加依赖 (3) 配置application.properties支持jsp (4) 编写测试Controller (5) 编写JSP页面 (6) 编写启动类App.java 创建Maven web project 阅读全文
posted @ 2018-07-16 11:50 曹英杰 阅读(617) 评论(0) 推荐(0) 编辑
摘要: 大纲 (1)在pom.xml中引入freemarker; (2)如何关闭freemarker缓存 (3)编写模板文件.ftl (4)编写访问文件的controller 在pom.xml中引入freemarker <dependency> <groupId>org.springframework.bo 阅读全文
posted @ 2018-07-16 11:34 曹英杰 阅读(557) 评论(0) 推荐(0) 编辑
摘要: 操作步骤 (1)在pom.xml中引入thymeleaf; (2)如何关闭thymeleaf缓存 (3)编写模板文件.html (4)编写访问模板文件controller 在pom.xml中引入thymeleaf 在pom.xml加入thymeleaf的依赖: <dependency> <group 阅读全文
posted @ 2018-07-16 11:26 曹英杰 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 知识点: 1.修改端口号 2.修改context-path 3.其它配置说明 配置端口号: Spring boot 默认端口是8080, 如果想要进行更改的话, 只需要修改applicatoin.properties文件, 在配置文件中加入: server.port=8081 配置context-p 阅读全文
posted @ 2018-07-16 11:02 曹英杰 阅读(562) 评论(0) 推荐(0) 编辑
摘要: (1)404 -- 确定地址是否输入正确,,此路径非彼路径 (2)404 -- 是否用对注解,此注解非彼注解 (3)404 -- 包路径是否正确,此包非彼包 (4)404 -- 确认类包是否正确,此类包非彼类包 阅读全文
posted @ 2018-07-16 10:52 曹英杰 阅读(303) 评论(0) 推荐(0) 编辑
摘要: 在一个项目中的异常我们我们都会统一进行处理的,那么如何进行统一进行处理呢? 新建一个类GlobalDefaultExceptionHandler, 在class注解上@ControllerAdvice, 在方法上注解上@ExceptionHandler(value = Exception.class 阅读全文
posted @ 2018-07-16 10:49 曹英杰 阅读(425) 评论(0) 推荐(0) 编辑
摘要: 实体类 DAO类 repository类 service类 controller类 阅读全文
posted @ 2018-07-16 10:37 曹英杰 阅读(180) 评论(0) 推荐(0) 编辑