《shiro学习(22):动态添加验证规则2.docx》由会员分享,可在线阅读,更多相关《shiro学习(22):动态添加验证规则2.docx(21页珍藏版)》请在金锄头文库上搜索。
1、shiro学习(22):动态添加验证规则2工具idea先看看数据库shiro_role_permission数据shiro_usershiro_user_role数据目录结构在pom.xml里面添加 4.0.0 geyaoshiro geyaoshiro 1.0-SNAPSHOT war geyaoshiro Maven Webapp http:/ UTF-8 1.7 1.7 junit junit 4.11 test org.apache.shiro shiro-core 1.2.3 org.slf4j slf4j-log4j12 1.6.1 org.slf4j slf4j-log4j12
2、1.6.1 org.springframework spring-jdbc 4.3.11.RELEASE com.mchange c3p0 0.9.5.2 org.apache.shiro shiro-web 1.2.3 javax.servlet javax.servlet-api 3.0.1 provided org.springframework spring-webmvc 4.2.8.RELEASE org.apache.shiro shiro-spring 1.4.0 org.springframework spring-web 4.2.8.RELEASE org.springfra
3、mework spring-context 4.2.8.RELEASE org.springframework spring-aop 4.2.8.RELEASE org.springframework spring-aop 4.2.8.RELEASE org.springframework spring-beans 4.2.8.RELEASE geyaoshiro maven-clean-plugin 3.1.0 maven-resources-plugin 3.0.2 maven-compiler-plugin 3.8.0 maven-surefire-plugin 2.22.1 maven
4、-war-plugin 3.2.2 maven-install-plugin 2.5.2 maven-deploy-plugin 2.8.2 引入插件easyuiAuthorExceptionHandlepackage com.geyao.shiro.exception;import org.apache.shiro.authz.UnauthorizedException;import org.springframework.http.HttpStatus;import org.springframework.web.bind.annotation.ControllerAdvice;import org.springframework.web.bind.annotation.E