-
Shiro框架在学习项目(基于maven下ssm+shiro)中的简单回顾
2018-09-28 08:50:09零、框架使用三步骤 1.使用框架为目的的三步骤: 2.已学习框架为目的的步骤:待完善 一、Shiro框架简介 二、Shiro框架架构 1.Shiro简单架构:Subject--SecurityManager--Realm 2.Shiro详细架构: Shiro架构...目录
1.Shiro简单架构:Subject--SecurityManager--Realm
3.自己写一个Realm类,把这个类ShiroUserRealm.java注入安全管理器的Realm属性
4.在web.xm配置(委托过滤器代理DelegatingFilterProxy)Shiro中的核心过滤器,负责拦截过滤请求信息
0.在数据库资源(菜单)表中添加权限标志符字段permission
五、Shiro框架的SessionManager和CacheManager
零、框架使用三步骤
1.使用框架为目的的三步骤:
- 导jar包
- 写配置文件
- 具体使用
2.已学习框架为目的的步骤:待完善
- 用熟框架
- 断点调试
- uml类关系结构图
- ...
一、Shiro框架简介
二、Shiro框架架构
1.Shiro简单架构:Subject--SecurityManager--Realm
2.Shiro详细架构:
Shiro架构相关要素
- Subject(主体):与软件交互的一个特定的实体(用户、第三方服务等)。
- SecurityManager(安全管理器) :Shiro 的核心,用来协调管理组件工作。
- Authenticator(认证管理器):负责执行认证操作
- Authorizer(授权管理器):负责授权检测
- SessionManager(会话管理):负责创建并管理用户 Session 生命周期,提供一个强有力的 Session 体验。
- SessionDAO:代表 SessionManager 执行 Session 持久(CRUD)动作,它允许任何存储的数据挂接到 session 管理基础上。
- CacheManager(缓存管理器):提供创建缓存实例和管理缓存生命周期的功能
- Cryptography(加密管理器):提供了加密方式的设计及管理。
- Realms(领域对象):是shiro和你的应用程序安全数据之间的桥梁。
Shiro架构常用功能
- 认证资源访问权限
- 授权资源访问权限<不使用Shiro授权管理还可以通过interceptor,aop实现>
- 缓存实例的创建和生命周期管理
- 加密方式设计和管理
三、Shiro框架基本配置
1.Shiro依赖配置:Spring整合Shiro
<dependency> <groupId>org.apache.shiro</groupId> <artifactId>shiro-spring</artifactId> <version>1.3.2</version> </dependency>
2.Shiro组件配置
- 向IOC注入安全管理SecurityManager对象,并为其realm属性注入引用实例shiroUserRealm<自己写的Realm>
- 向IOC注入Shiro过滤工厂ShiroFilterFactory:
- 为其securityManager属性注入securityManager
- 为其loginUrl属性注入登录页url,例如本例:"/doLoginUI.do"
- 为其FilterChainDefinitionMap属性注入过滤链Map,哪些资源要过滤key:资源路径,什么权限可以访问value:anon匿名,即不登录也可以访问/logout登出时可访问/authc需要认证才能访问
- 向IOC注入生命周期管理LifecycleBeanPostProcessor
备注:官文+有道... Spring的Bean post处理器,它在实现可初始化或可销毁接口的Shiro对象上自动调用init()和/或destroy()方法。这个post处理器使在Spring中配置Shiro bean变得更加容易,因为用户不必担心是否必须指定init-method和-method bean属性。
- 向IOC注入Bean对象的代理DefaultAdvisorAutoProxyCreator
- 向IOC注入授权属性AuthorizationAttributeSourceAdvisor,并向其注入属性securityManager
<?xml version="1.0" encoding="UTF-8"?> <beans default-lazy-init="true" xmlns="http://www.springframework.org/schema/beans" xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:util="http://www.springframework.org/schema/util" xmlns:jpa="http://www.springframework.org/schema/data/jpa" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.3.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.3.xsd http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa-1.3.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd" > <!-- 配置shiro中的SecurityManager --> <bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager"> <property name="Realm" ref="shiroUserRealm"/> </bean> <!-- 配置Shiro的FilterFactoryBean对象 --> <bean id="shiroFilterFactory" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean"> <property name="SecurityManager" ref="securityManager"/> <!-- 设置此项的目的是让用户进行登录认证 --> <property name="LoginUrl" value="/doLoginUI.do"/> <!-- 设置请求过滤规则 --> <property name="FilterChainDefinitionMap"> <map> <entry key="/bower_components/**" value="anon"/> <entry key="/build/**" value="anon"/> <entry key="/dist/**" value="anon"/> <entry key="/plugins/**" value="anon"/> <entry key="/user/doLogin.do" value="anon"/> <entry key="/doLogout.do" value="logout"/> <entry key="/**" value="authc"/><!-- 必须认证 --> </map> </property> </bean> <!-- 配置bean对象的生命周期管理 --> <bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"> </bean> <!-- 配置Bean对象的代理 --> <bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" depends-on="lifecycleBeanPostProcessor"> </bean> <!-- 配置授权属性--> <bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor"> <property name="SecurityManager" ref="securityManager"/> </bean> </beans>
3.自己写一个Realm类,把这个类ShiroUserRealm.java注入安全管理器的Realm属性
自定义一个Realm类继承自授权域AuthorizingRealm,包含信息:
- 密码加密方式(加密算法/次数等):重写public void setCredentialsMatcher(CredentialsMatcher credentialsMatcher);
- 认证信息:重写protected AuthenticationInfo doGetAuthenticationInfo( AuthenticationToken token);
- 授权信息:重写protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals);
/** * 此对象中要完成用户认证信息,授权信息 * 的获取和封装等业务操作。 */ @Service public class ShiroUserRealm extends AuthorizingRealm { @Autowired private SysUserDao sysUserDao; @Autowired private SysUserRoleDao sysUserRoleDao; @Autowired private SysRoleMenuDao sysRoleMenuDao; @Autowired private SysMenuDao sysMenuDao; /** * 指定加密算法和加密次数(默认就是1次) * @param credentialsMatcher */ @Override public void setCredentialsMatcher(CredentialsMatcher credentialsMatcher) { HashedCredentialsMatcher hashMatcher= new HashedCredentialsMatcher("MD5"); hashMatcher.setHashIterations(1);//默认加密次数为一次 super.setCredentialsMatcher(hashMatcher); } /** * 负责用户认证信息的获取以及封装 */ @Override//认证 protected AuthenticationInfo doGetAuthenticationInfo( AuthenticationToken token) throws AuthenticationException { System.out.println("doGetAuthenticationInfo"); //1.获取用户身份信息(例如用户名) String userName=(String)token.getPrincipal();//身份(控制层提交) //2.基于用户名访问数据库获取用户信息 SysUser user=sysUserDao.findUserByUserName(userName); //3.对用户信息进行验证 //3.1验证是否为空(为空说明此此用户不存在) if(user==null) throw new UnknownAccountException(); //3.2验证此用户是否被禁用了(禁用则不允许登录) if(user.getValid()==0) throw new LockedAccountException(); //4.基于业务封装用户数据?(例如密码,盐值) ByteSource credentialsSalt= ByteSource.Util.bytes(user.getSalt()); SimpleAuthenticationInfo info=new SimpleAuthenticationInfo( user, //principal (身份) user.getPassword(),//hashedCredentials(已加密的密码) credentialsSalt, //credentialsSalt this.getName());//realmName(当前类的名字) System.out.println("realmName="+this.getName()); return info;//将此值返回给认证管理器(Authentication) } /**负责用户授权信息({"sys:user:valid",...}) * 的获取及封装*/ @Override//授权 protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) { System.out.println("doGetAuthorizationInfo"); //1.获取用户id(基于此id逐步获取用户具备的权限) SysUser user=(SysUser)principals.getPrimaryPrincipal(); //2.基于用户id获取角色信息(用户角色中间表:user_id,role_id) List<Integer> roleIds=sysUserRoleDao.findRoleIdsByUserId(user.getId()); //3.基于角色id获取菜单id(角色菜单关系表:role_id,menu_id) List<Integer> menuIds= sysRoleMenuDao.findMenuIdsByRoleIds( roleIds.toArray(new Integer[]{})); //4.基于菜单id获取权限标识(例如"sys:user:valid") List<String> permissions= sysMenuDao.findPermissions( menuIds.toArray(new Integer[]{})); //5.封装权限信息 SimpleAuthorizationInfo info= new SimpleAuthorizationInfo(); Set<String> perSet=new HashSet<>(); for(String per:permissions){ if(!StringUtils.isEmpty(per)){ perSet.add(per); } } System.out.println("user.permissions="+perSet); info.setStringPermissions(perSet); return info;//此对象会传递给谁?授权管理器 } }
4.在web.xm配置(委托过滤器代理DelegatingFilterProxy)Shiro中的核心过滤器,负责拦截过滤请求信息
<!-- Shiro中的核心过滤器(负责拦截请求) --> <filter> <filter-name>shiroFilter</filter-name> <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> <init-param> <param-name>targetBeanName</param-name> <param-value>shiroFilterFactory</param-value> </init-param> </filter> <filter-mapping> <filter-name>shiroFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
四、Shiro框架应用
0.在数据库资源(菜单)表中添加权限标志符字段permission
三表关系:用户对应角色,角色对应资源
- 用户表
- 角色表
- 资源表 添加权限标志字段
1.登录认证大致流程 基于spring、半注解方式
- 基本场景:客户端用户输入用户名+密码点击确定按钮,后台认证用户信息并做出正确响应;
- Dao层:提供通过用户名查询用户表信息的方法
- Service层:提供***Realm类(含密码加密方式/认证信息/授权信息),如public class ShiroUserRealm extends AuthorizingRealm
- Controller层:提供登录页跳转@RequestMapping("doLoginUI"),登录信息认证响@RequestMapping("doLogin")+@ResponseBody
- 登录页login.html编写:提供点击事件进行点击登录操作,实现异步登录操作
Controller层代码示意
@RequestMapping("/") @Controller public class SysLoginController { @RequestMapping("doLoginUI") public String doLoginUI(){ return "login"; } @RequestMapping("doLogin") @ResponseBody public JsonResult doLogin(String username,String password){ //1.获取Subject对象 Subject subject=SecurityUtils.getSubject(); //2.通过Subject提交用户信息,交给shiro框架进行认证操作 //2.1对用户进行封装 UsernamePasswordToken token= new UsernamePasswordToken( username,//身份信息 password);//凭证信息 //2.2对用户信息进行身份认证 subject.login(token); //分析: //1)token会传给shiro的SecurityManager //2)SecurityManager将token传递给认证管理器 //3)认证管理器会将token传递给realm return new JsonResult("login ok"); } }
2.授权流程 基于spring、半注解方式
用户授权大致流程
- 基本场景
- Dao层:
- 提供通过用户id查询用户角色中间表信息的方法;
- 提供同过用户角色id查询角色资源中间表信息的方法;
- 提供通过资源id查询资源表信息的方法;
- Service层:与登录认证一样在自定义Realm里提供授权所需的用户拥有的权限标志符
- 授权过程在后台完成所以不需要在Controller层写相关代码,只需要注解方式注明相关方法要求的权限标志符
授权检测:使用注解修饰方法method或class类
//For example, this declaration: @RequiresPermissions( {"file:read", "write:aFile.txt"} ) void someMethod();
@RequiresPermissions("sys:user:valid")
五、Shiro框架的SessionManager和CacheManager
Shiro缓存配置
1.添加Shiro缓存依赖
<dependency> <groupId>org.apache.shiro</groupId> <artifactId>shiro-ehcache</artifactId> <version>1.3.2</version> </dependency>
2.Shiro缓存的配置文件ehcache.xml
- 在IOC中注入EhCacheManager,并为其缓存管理配置文件cacheManagerConfigFile属性注入值
<bean id="cacheManager" class="org.apache.shiro.cache.ehcache.EhCacheManager"> <property name="cacheManagerConfigFile" value="classpath:ehcache.xml"/> </bean>
- 在IOC中注入的安全管理DefaultWebSecurityManager
- 缓存管理属性值注入
- 域属性值注入
<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager"> <property name="cacheManager" ref="cacheManager"/> <property name="realm" ref="shiroUserRealm"></property> </bean>
3.其他内容待更新
-
maven在SSM项目中整合shiro框架的用法
2018-07-23 17:30:54首先我是使用maven开发的项目,既然使用shiro框架首先肯定是要加入相关的支持的,我们要导入shiro相关的jar包 shiro分为好几个jar,在这里我导入一个包括全部的方便以后使用:使用的是1.2.4版本的支持。 <!...之前一直有听说shiro是个很不错的安全框架,最近项目正好用到认证授权这一块,就尝试着自己学了一下,现在把如何去整合的步骤分享给大家,也好让自己做个笔记。
首先我是使用maven开发的项目,既然使用shiro框架首先肯定是要加入相关的支持的,我们要导入shiro相关的jar包
shiro分为好几个jar,在这里我导入一个包括全部的方便以后使用:使用的是1.2.4版本的支持。
<!-- shiro -->
<!-- https://mvnrepository.com/artifact/org.apache.shiro/shiro-all -->
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-all</artifactId>
<version>1.2.4</version>
</dependency>加入之后maven会自动下载到仓库中
第二个需要配置项目的web.xml配置由shiro提供的过滤器
<!-- 配置由Spring提供的过滤器,用于整合shiro框架 -->
<!-- 在项目启动的过程中,当前过滤器会从Spring工厂中提取同名对象 -->
<filter>
<filter-name>shiroFilter</filter-name>
<filter-class>
org.springframework.web.filter.DelegatingFilterProxy
</filter-class>
</filter>
<filter-mapping>
<filter-name>shiroFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>注意:这里的filter-name要和我们的shiro配置文件的管理器的id一致,否则会报异常
接下来创建shiro的配置文件:shiro-context.xml 创建这个配置文件我们要在web.xml中加载上
<servlet>
<servlet-name>SpringMvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:spring-mvc.xml
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>这是初始化的springmvc,后面又加一个
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring-mybatis.xml,
classpath:shiro-context.xml
</param-value>
</context-param>最基本的配置算是完成了。接下来看一下,shiro-context.xml是如何配置的
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd"><bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean"><!--这里的id和filter-name一致-->
<property name="securityManager" ref="securityManager" /> <!--加载管理器-->
<property name="loginUrl" value="/user/login" /> <!--没有登录的时候,跳转到这个页面-->
<property name="unauthorizedUrl" value="/user/nopermission" /> <!--当没有权限的时候,跳转到这个url-->
<property name="filterChainDefinitions">
<value>
<!-- /*=anon -->
/user/login = anon<!--可以不需要登录-->
<!--/user/readName = authc, perms[/readName] perms 表示需要该权限才能访问的页面 -->
<!-- /user/readData = authc, perms[/readData]-->
/user/* = authc <!-- authc 表示需要认证才能访问的页面 -->
</value>
</property>
</bean><!-- 自定义Realm -->
<bean id="myShiroRealm" class="com.mhkjup.artcircle.shiro.MyShiroReaml">
<!-- businessManager 用来实现用户名密码的查询 -->
<property name="shiroService" ref="accountService" />
</bean><bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
<!-- 注入realm -->
<property name="realm" ref="myShiroRealm"/>
</bean><!--声明一个Service 注入到自定义Realm-->
<bean id="accountService" class="com.mhkjup.artcircle.service.impl.ShiroServiceImpl"/>
<!-- <bean id="shiroCacheManager" class="org.apache.shiro.cache.ehcache.EhCacheManager">
<property name="cacheManager" ref="cacheManager" /> </bean> -->
</beans>其他具体代码就需要自己去实现了
-
使用使用maven项目实现Java安全框架Shiro的内置Realm:IniRealm进行登陆权限验证
2018-12-23 22:48:521.我们先建一个maven项目,如图: 2.在pom.xml中添加如下依赖: <dependencies> <dependency> <groupId>org.apache.shiro</groupId> <...1.我们先建一个maven项目,如图:
2.在pom.xml中添加如下依赖:
<dependencies> <dependency> <groupId>org.apache.shiro</groupId> <artifactId>shiro-core</artifactId> <version>1.4.0</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>RELEASE</version> </dependency> </dependencies>
3.创建一个user.ini文件,该文件保存用户基本信息和权限信息,user.ini的基本信息如下:
[users] \#提供了对用户/密码及其角色的配置,用户名=密码,角色1,角色2 root=123456,admin [roles] \#提供了角色及权限之间关系的配置,角色=权限1,权限2 admin=user:delete
4.现在正式开始编码,包括检查登陆认证、含有权限,代码如下:
package com.wkf; import org.apache.shiro.SecurityUtils; import org.apache.shiro.authc.UsernamePasswordToken; import org.apache.shiro.mgt.DefaultSecurityManager; import org.apache.shiro.realm.text.IniRealm; import org.apache.shiro.subject.Subject; import org.junit.Test; /** * 使用内置IniRealm类读取用户 * @author wkf */ public class IniRealmTest { @Test public void testAuthentication(){ IniRealm iniRealm = new IniRealm("classpath:user.ini");//读取用户信息文件,IniRealm类:用户信息存储类 //1.构建SecurityManager环境 DefaultSecurityManager defaultSecurityManager = new DefaultSecurityManager(); defaultSecurityManager.setRealm(iniRealm); //2.主体提交认证请求 SecurityUtils.setSecurityManager(defaultSecurityManager); Subject subject = SecurityUtils.getSubject(); UsernamePasswordToken token = new UsernamePasswordToken("root","123456"); subject.login(token);//登陆认证 System.out.println("认证结果:"+subject.isAuthenticated()); subject.checkRole("admin");//检查角色授权(必须登陆认证后才行) subject.checkPermission("user:delete");//检查角色权限 } }
-
权限管理系统_SpringBoot+Maven+JPA+Shiro实现用户权限管理系统(源码分享)
2021-01-10 18:12:01项目描述日常工作中,权限管理是管理系统必不可少的功能。网络上有各种各样的权限管理系统,不过用别人的总不如自己写一套来的踏实。之前本菜鸟分享的例子里有各种技术点的分项实例,这次做一个综合,形成自己的简单...项目描述
日常工作中,权限管理是管理系统必不可少的功能。网络上有各种各样的权限管理系统,不过用别人的总不如自己写一套来的踏实。之前本菜鸟分享的例子里有各种技术点的分项实例,这次做一个综合,形成自己的简单通用的权限管理系统。设计思路源于经典的RBAC模型,即:用户通过角色操作资源。在实现上,基本实现了功能权限,包含了资源菜单的显示控制以及页面上按钮粒度的显示控制。并且附送了使用Springboot发送邮件的功能。
关于源码已经全部都上传完毕,如果有需要用到这份源码的的朋友, 关注后帮忙转发文章,后台私信【源码】就能免费获取到了
运行环境
JDK8 + MariaDB(MySQL) + IDEA + Maven
项目技术
SpringBoot + JPA + Shiro + Easyui
jar包文件
用SpringBoot,Maven自动下载
项目截图
注意事项
1.启动后会自动新建表,但是需要实现新建数据库才可以
2.发送邮件失败,请配置非QQ邮箱的smtp服务
-
细说shiro之三:在独立应用中使用shiro
2019-09-17 23:58:12官网:https://shiro.apache.org/ 1. 下载 在非Web环境的独立应用中使用Shiro时,只需要shiro-core组件。 在Maven项目中的依赖配置如下: <dependency> <groupId>org.apache.s... -
java web shiro_细说shiro之四:在web应用中使用shiro
2021-03-09 03:04:501. 下载在Maven项目中的依赖配置如下:org.apache.shiroshiro-core1.3.2org.apache.shiroshiro-web1.3.2org.slf4jslf4j-api1.7.25org.slf4jslf4j-jcl1.7.25commons-loggingcommons-logging1.2特别地!Shiro使用了... -
细说shiro之四:在web应用中使用shiro
2018-09-11 17:33:001. 下载在Maven项目中的依赖配置如下: <!-- shiro配置 --> <dependency> <groupId>org.apache.shiro</groupId> <artifactId>shiro-core</artifactId... -
shiro架构之三------在独立应用中使用shiro
2018-12-12 14:22:14在非Web环境的独立应用中使用Shiro时,只需要shiro-core组件。 在Maven项目中的依赖配置如下: <dependency> <groupId>org.apache.shiro</groupId> <... -
JavaWeb项目中Shiro权限框架的使用
2021-03-25 22:35:53No.1 首先在pom,xml文件中导入依赖: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:... -
shiro框架之四------在web中使用shiro
2018-12-12 14:24:28在Maven项目中的依赖配置如下: <!-- shiro配置 --> <dependency> <groupId>org.apache.shiro</groupId> <artifactId>shiro-core&... -
Shiro入门4:Shiro环境搭建【基于Maven】
2016-03-23 17:24:30在这里我使用了Maven作为项目JAR包管理,只要使用下面提供的Shiro在Apache里面的仓库就可以轻松快捷地加入Shiro框架在WEB程序中所需要的代码。 如果没有使用Maven的可以在Shiro官网下载所需要的JAR包也是可以使用的... -
shiro框架之五-----在spring框架中使用shiro
2018-12-12 14:25:43在Maven项目中的依赖配置如下: <!-- shiro配置 --> <dependency> <groupId>org.apache.shiro</groupId> <artifactId>shiro-core&... -
shiro权限项目中的简单应用
2017-04-20 14:15:24项目需要使用shiro,所以自学了几天,仅提供给新手,请根据文档查看…该项目仅是测试项目,并不完善,只实现了需要使用的基本功能,并且只提供了使用shiro模块的代码。楼主新人第一次写,如有问题希望能提出来,由衷... -
Eclipse中导入maven项目
2020-09-29 09:26:28后端基础框架搭建 前端基础框架搭建 架构完善 系统登录功能实现 ...SpringBoot2.2.4+mybatisplus+shiro+layui+layuimini 2.数据库:mysql5.7 3.jdk1.8 4.缓冲:redis3.2 5.开发工具 后台用的是IDEA 前台HBuil -
一站式学习Java框架技术(Maven+SSM+SpringBoot+Shiro+Redis+Nginx+项目实战)
2019-11-27 10:05:53以工作必需框架为导向,深度剖析 Java 技术栈开发的八大核心框架:Maven、SSM、SpringBoot、Shiro、Redis、Nginx,并将所学框架进行整合完成全方位实战项目演练,助你能够游刃有余地游走在这些技术之中,轻松掌握 P5... -
student_ssm:使用maven管理,集成SSH框架和shiro的学生管理系统-源码
2021-02-24 04:10:41student_ssm 使用maven管理,集成...该项目中的数据库备份恢复的功能并没有考虑通用的情况,需要配置mysqldump的路径,并且文件输出路径也是固定的,具体实现可以到Backup.jsp和Restore.jsp文件查看 访问的页面链接为 -
《使用MAVEN+SSM+Ajax+shiro+MySql开发在线商场详解(3)》
2020-06-05 13:05:23创建Maven JavaWeb项目 配置 web.xml 在pom.xml 中 <bulid> 创建tomcat7插件 地址 进入maven仓库地址 Maven仓库地址 maven tomcat7插件地址 maven tomcat7地址,直接跳转 <plugin> <... -
Spring+SpringMVC+Mybatis+Shiro+ Maven+AdminLTE(Bootstarp)整合项目
2017-12-20 17:38:04Spring+SpringMVC+Mybatis+Shiro+ Maven+AdminLTE(Bootstarp)整合项目 4、改造功能 (1)登录功能 (2)登录界面背景图片 (3)登录增加tab框 (4)登录成功后增加消息组件--未实现真正消息功能 (5)增加换肤... -
Shiro 项目开发中第一次使用到,所以研究了一下,这里
2017-09-15 10:41:07项目使用的是Maven 首先要在pom.xml中引入shiro依赖 org.apache.shiro shiro-core ${shiro.version} org.apache.shiro shiro-web ${shiro.version} org.apache.shiro shiro-spring -
maven项目手动排除某个jar包
2020-11-18 20:14:28myeclipse排除maven项目中特定的jar依赖:1. 搜索该jar的位置2. 使用`exclusions`标签排除jar 1. 搜索该jar的位置 在项目中,由于某个公共的jar,可能在我们引入不同的依赖时,会存在版本冲突,或者我没有用到这个... -
shiro权限maven工程使用了html5,bootstap,springmvc,mybatis,jquery等技术整合
2016-01-20 15:20:57前端:html5,jquery,bootstrap 数据库连接池:druid 后端:springmvc,mybatis等 已实现用户以及权限模块。使用前请先看工程中ReadMe文档。注意该项目为maven工程连接外网可以自动在maven.apache.org下载jar包。 -
shiro使用
2019-01-04 09:33:19shiro使用场景: ...以下针对maven项目管理来说的 1、在pom.xml中添加依赖 <!--shiro start--> <!-- https://mvnrepository.com/artifact/org.apache.shiro/shiro-core --> ...