shiro 自定义logout路径

Shiro的登出操作由LogoutFilter处理,通常会重定向到'/'. 通过设置filters或filterChainDefinitions,可以自定义logout的重定向URL,即修改redirectUrl属性的值,实现自定义的登出路径。登出时实际调用了SecurityUtils.getSubject().logout()方法。
摘要由CSDN通过智能技术生成
${adminPath}/logout = logout

shiro 登出走 LogoutFilter 过滤器,登出默认重定向到redirecUrl这个地址(/)

public class LogoutFilter extends AdviceFilter {
    
    private static final Logger log = LoggerFactory.getLogger(LogoutFilter.class);

    /**
     * The default redirect URL to where the user will be redirected after logout.  The value is {
   @code "/"}, Shiro's
     * representation of the web application's context root.
     */
    public static final String DEFAULT_REDIRECT_URL = "/";

    /**
     * The URL to where the user will be redirected after logout.
     */
    private String redirectUrl = DEFAULT_REDIRECT_URL;


<!-- 自定义退出路径 -->
<bean id="logout" class="org.apache.shiro.web.filter.authc.LogoutFilter">
    <property name="redirectUrl
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值