摘要: 1.创建Maven Web Project项目并添加依赖 pom.xml 2.编写application.properties并添加配置 3.编写Controller文件 4.编写index.jsp文件 5.编写启动类 特别说明:针对el表达式,类似${hello} 这个对于servlet的版本是有 阅读全文
posted @ 2017-08-10 16:58 十月围城小童鞋 阅读(112) 评论(0) 推荐(0) 编辑
摘要: springBoot使用thymeleaf和freemarker模板引擎 1.添加thymeleaf或者freemarker的依赖包 2.在application.properties文件中添加thymeleaf或freemarker配置并关闭缓存 3.在src/main/resources下新建t 阅读全文
posted @ 2017-08-10 11:22 十月围城小童鞋 阅读(253) 评论(0) 推荐(0) 编辑
摘要: springBoot全局异常捕捉 /** * 1、新建一个Class,这里取名为GlobalDefaultExceptionHandler * 2、在class上添加注解,@ControllerAdvice; * 3、在class中添加一个方法 * 4、在方法上添加@ExcetionHandler拦 阅读全文
posted @ 2017-08-10 10:40 十月围城小童鞋 阅读(68) 评论(0) 推荐(0) 编辑