spring boot web
fight8921
一_道_门
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
springboot统一异常处理
@ControllerAdvice@Slf4jpublic class MyExceptionHandler { Integer code = RespCode.RespEnum.SYSERROR_PERMISSIONS_403.getCode(); String message = RespCode.RespEnum.SYSERROR_PERMISSIONS_403.getDescribe(); @ExceptionHandler(BizException.class)原创 2020-05-12 10:05:00 · 290 阅读 · 0 评论 -
01spring boot web 静态资源获取路径
“classpath:/META-INF/resources/”“classpath:/resources/”“classpath:/static/”“classpath:/public/”“/”:当前项目根路径添加资源映射欢迎页映射配置网页图标想改变默认的静态资源访问路径配置如下...原创 2019-09-20 17:10:50 · 222 阅读 · 0 评论 -
02thymeleaf
https://www.thymeleaf.org/模板引擎常用的有jsp,freemarker,Thymeleafspring boot 默认不支持jsp思想Thymeleaf引入org.springframework.bootspring-boot-starter-thymeleaf版本替换修改thymeleaf 注意布局版本对应thymeleaf 使用与语法默认规...原创 2019-09-21 10:49:38 · 737 阅读 · 0 评论 -
03spring boot web springmvc自动配置原理
springboot中使用springmvchttps://docs.spring.io/spring-boot/docs/2.1.8.RELEASE/reference/html/boot-features-developing-web-applications.htmlspringboot 为springmvc做了哪些自动配置29.1.1 Spring MVC Auto-configur...原创 2019-09-21 14:48:41 · 239 阅读 · 0 评论 -
04springboot web 引入资源
静态资源放入static,动态页面放入templates访问首页一种写法在没有返回数据的情况下可以这样写前端资源引入加入th提示引入webjars与自定义的样式...原创 2019-09-21 16:01:29 · 190 阅读 · 0 评论 -
05springboot web 国际化
Spring MVC 国际化实现1.编写国际化配置文件2.使用ResourceBundleMessageSource管理国际化资源文件3.在页面使用fmt:message取出国际化内容springboot1.编写国际化配置文件,抽取页面需要显示的国际化消息login.properties 默认语言2.SpringBoot自动配置好了管理国际化资源文件的组件 3、去页面获取国际化的值...原创 2019-09-21 16:48:29 · 170 阅读 · 0 评论 -
06SpringBoot web 登录拦截器
防止表单重复提交使用重定向方式登录后重定向添加视图映射当访问/main.html路径时展示dashboard.html页面通过拦截器做登录检查没有登录的用户就不能操作后台添加拦截器注册拦截器addInterceptorsaddInterceptors添加拦截器registry.addInterceptor(new LoginHandlerInterceptor()).添加需...原创 2019-09-23 14:24:57 · 240 阅读 · 0 评论 -
07crud 普通与Restful区别
案例请求架构原创 2019-09-23 14:52:28 · 314 阅读 · 0 评论 -
08thymeleaf 公共抽取
参考https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.pdf原创 2019-09-23 15:22:24 · 185 阅读 · 0 评论 -
09SpringBoot web 错误处理
原理参照ErrorMvcAutoConfiguration,错误处理的自动配置给容器中添加的组件1.DefaultErrorAttributes2.BasicErrorController3.ErrorPageCustomizer4.DefaultErrorViewResolver1.定制错误页面有模板引擎的情况下;error/状态码; 【将错误页面命名为 错误状态码.html 放在...原创 2019-09-25 11:34:59 · 1763 阅读 · 0 评论 -
10封装树状结构数据
public List<Map<String, Object>> getMenuInfo(){ SysMenu sysMenuOne1 = new SysMenu(); sysMenuOne1.setId(1); sysMenuOne1.setName("权限管理"); SysMenu sysMen...原创 2019-10-08 13:12:18 · 240 阅读 · 0 评论 -
11嵌入式Servlet容器配置修改
如何定制和修改Servlet容器的相关配置;1、修改和server有关的配置(ServerProperties【也是EmbeddedServletContainerCustomizer】);原创 2019-10-23 19:32:29 · 212 阅读 · 0 评论
分享