2019独角兽企业重金招聘Python工程师标准>>>

1. 普通的action中 实现自己的logout方法,取到Subject,然后logout这种需要在ShiroFilterFactoryBean 中配置filterChainDefinitions 对应的action的url为anon。

<property name="filterChainDefinitions"> <value> # some example chain definitions: /index.htm = anon /logout = anon /unauthed = anon /console/** = anon /css/** = anon /js/** = anon /lib/** = anon /admin/** = authc, roles[admin] /docs/** = authc, perms[document:read] /** = authc # more URL-to-FilterChain definitions here </value>
</property>

2. 使用shiro提供的logout filter,自定义redirectUrl。

<bean id="logout" class="org.apache.shiro.web.filter.authc.LogoutFilter"> <property name="redirectUrl" value="/loginform" /> </bean>

然后将相应的url filter配置为logout如下

<property name="filterChainDefinitions"> <value> # some example chain definitions: /index.htm = anon /logout = logout /unauthed = anon /console/** = anon /css/** = anon /js/** = anon /lib/** = anon /admin/** = authc, roles[admin] /docs/** = authc, perms[document:read] /** = authc # more URL-to-FilterChain definitions here </value>
</property>

转载于:https://my.oschina.net/u/1425545/blog/540988

Spring和shiro整合 logout 配置方式相关推荐

  1. 小结spring和struts整合的三类方式

    小结spring和struts整合的三类方式 整合spring和hibernate的三种方式,小结之. 1) 在struts中使用webapplicationcontext调用spring     声 ...

  2. Spring Bean的三种配置方式

    目录 一.传统的XML配置方式 二.基于java注解的配置 三.基于类的Java Config 正文 Spring Bean有三种配置方式: 传统的XML配置方式 基于注解的配置 基于类的Java C ...

  3. Spring定时任务@Scheduled注解使用配置方式(cron表达式、fixedRate和fixedDelay)

    Spring定时任务@Scheduled注解使用配置方式(cron表达式.fixedRate和fixedDelay) 序言: 个人推荐一个很方便的在线Cron生成器(网页版):https://qqe2 ...

  4. spring + mybatis + c3p0 整合(配置篇)

    摘要 近期由于项目使用mybatis出现了数据源阻塞,导致应用程序假死,服务超时引发严重后果,故此下定决心重新梳理一下spring+mybatis+c3p0整合问题,主要分为:配置.源码(通过一次数据 ...

  5. spring中 shiro logout 配置方式

    有两种方式实现logout 1. 普通的action中 实现自己的logout方法,取到Subject,然后logout 这种需要在ShiroFilterFactoryBean 中配置 filterC ...

  6. Spring框架学习day_01: 框架配置方式/ 管理对象的作用域/ 生命周期/ 组件扫描/ 单例模式:“懒汉式“,“饿汉式“

    1. Spring框架的作用 Spring框架的主要作用是创建对象和管理对象. 创建对象:类似于User user = new User(); 管理对象:随时可以通过Spring框架获取对象,甚至Sp ...

  7. spring boot filter配置方式

    spring boot 加载外部filter方式 spring boot filter两种配置方式 1.自定义filter配置 2.加载外部jar包配置 spring boot filter两种配置方 ...

  8. springboot 与shiro整合

    shiro~ shiro快速入门 springboot 整合shiro 核心目标 清爽pom 用户认证授权认证,与数据库交互 shiro configuration 核心controller 获取sh ...

  9. Spring MVC之基于xml配置的web应用构建

    2019独角兽企业重金招聘Python工程师标准>>> 更多spring博文参考: http://spring.hhui.top/ 直接用SpringBoot构建web应用可以说非常 ...

最新文章

  1. 网络编程 UDP通信的过程 TCP通信过程 多线程文件上传
  2. 误删除的文件夹还能恢复吗?
  3. RID枚举工具RidEnum
  4. A winner is a dreamer who never gives up
  5. java hashtable排序_java中哈希表中有迭代器模式的实现,可以认为其是顺序表吗?...
  6. 联想Ideapad 710S-13IKB笔记本安装win10系统不认硬盘解决方法
  7. 第12章[12.7] Ext JS实现带动态数字的图标
  8. Python学习之OS模块初识
  9. 3月22 坐标系转换,旋转矩阵,仿射变换,例子,相机与世界,欧拉角与轴角公式,一个坐标系下面的轨迹
  10. 贴吧android客户端,百度贴吧推出Android平台手机客户端
  11. 计算机表格的条件公式,电脑Excel输出时如何进行多条件判断
  12. 居家办公,无需公网IP远程桌面内网电脑【免费内网穿透】
  13. Codeforces 1027C. Minimum Value Rectangle
  14. 扫码签到突破100000用户
  15. 关于“u盘打开为空,但是占用空间”的解决方法之一
  16. 理解Nand Flash原理图
  17. 博客:固定位置增加二维码
  18. 实验四:组合电路设计实验之一 (血型关系通过逻辑电路的实现)
  19. sublime 正则跨行匹配
  20. PHP刹车助力,自动刹车辅助都是骗人玩意儿?

热门文章

  1. python入门教程非常详细-Python 基础教程
  2. python有趣的小项目-有趣的十个Python实战项目,让你瞬间爱上Python!
  3. python编程入门书-清华大学出版社-图书详情-《Python编程入门与案例详解》
  4. [shell]shell中if语句的使用
  5. spoj453 Sums in a Triangle (tutorial) 动态规划
  6. shell中的文件处理
  7. 进程通信学习笔记(Posix消息队列)
  8. QPixmap: It is not safe to use pixmaps outside the GUI thread原因
  9. Eclipse如何导入maven项目,以及配置maven
  10. loj #6053 简单的函数 min_25筛