用来整理spring-boot关联的知识
项目依赖于官方spring-boot, 在pom.xml文件里面配置
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.1.0.RC1</version>
</parent>
-
/META-INF/resources/
-
/resources/
-
/static/
-
/public/
spring boot 增加InterceptorRegistry拦截器, 拦截路径user/下所有路径
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new UserSecurityInterceptor()).addPathPatterns("/user/**");
}
增加加密EncryptUtils操作, 处理MD5加密, 盐值加密, SHA加密, PBKDF2加密
/**
* 获取当前Request
* @return
*/
private HttpServletRequest getRequest() {
ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes();
return requestAttributes.getRequest();
}
<img src="holder.js/200x300/sky">
demo: http://localhost:8080/user/home/holder