【问题标题】:Grails Filter to Detect Session TimeoutsGrails 过滤器检测会话超时
【发布时间】:2015-06-05 23:32:21
【问题描述】:

Grails 中是否支持过滤器? 我需要一个过滤器来检测http session timeouts 并将用户引导到适当的页面,要求他们再次登录。 spring security 核心插件是否已经提供了这个功能? 我找不到任何可靠的信息。

提前致谢。

【问题讨论】:

标签: grails filter


【解决方案1】:

Grails 中是否支持过滤器?

是的。您可以按照通常的 Java servlet 应用程序在 web.xml 中注册 servlet 过滤器,但更常见的是使用 Grails 自己的过滤器支持,该支持记录在 http://grails.org/doc/latest/guide/theWebLayer.html#filters

class SessionTimeoutFilters {
    def filters = {
        all(controller: '*', action: '*') {
            // impose your logic here
        } 
    }
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-22
    • 2019-01-12
    • 2013-10-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多