<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    asdtiang的博客 感謝blogjava提供的博客交流平臺

    grails acegi 在線用戶統計

    Posted on 2011-01-10 12:03 asdtiang 閱讀(714) 評論(0)  編輯  收藏 所屬分類: grails study
    主要參考文檔:http://grails.1312388.n4.nabble.com/Information-about-all-logged-in-users-with-Acegi-or-SpringSecurity-in-Grails-td1372911.html

    根據文檔,基本操作翻譯如下:(注意只統計在線用戶,也就是登錄的用戶)

    在SecurityConfig中設置 useHttpSessionEventPublisher 為true,
    // HttpSessionEventPublisher
     useHttpSessionEventPublisher = true
    這樣不用更改web.xml文件

    resources.groovy:文件增加以下bean:
       beans = {

          sessionRegistry(org.springframework.security.concurrent.SessionRegistryImpl)

          sessionController(org.springframework.security.concurrent.ConcurrentSessionControllerImpl) {
             maximumSessions = -1 //表示同一個賬戶可以多次登錄,但只計一個在線用戶
             sessionRegistry = ref('sessionRegistry')
          }
       }

    BootStap對應增加以下內容:
    class BootStrap {

          def authenticationManager
          def sessionController

          def init = { servletContext ->
             authenticationManager.sessionController = sessionController
          } 
          def destroy = {}
       }


    測試

    class OnlineController {
     def sessionRegistry
     def test={
          render sessionRegistry.getAllPrincipals().length
      }

    }
    主要類的文檔:
    ConcurrentSessionControllerImpl:
    http://static.springsource.org/spring-security/site/docs/2.0.x/apidocs/org/springframework/security/concurrent/ConcurrentSessionControllerImpl.html
    SessionRegistryImpl:
    http://static.springsource.org/spring-security/site/docs/2.0.x/apidocs/org/springframework/security/concurrent/SessionRegistryImpl.html









    天蒼蒼,野茫茫,風吹草底見牛羊

    posts - 80, comments - 24, trackbacks - 0, articles - 32

    Copyright © asdtiang

    asdtiang的博客 PaidMailz
    點擊廣告網賺A(每天4個廣告,每個0.0025美元,一個搜索廣告0.03美元)
    主站蜘蛛池模板: 亚洲成a人片在线观看国产| 97视频免费在线| 亚洲精品视频在线看| 亚洲乱色伦图片区小说| 国内自产少妇自拍区免费| 亚洲免费视频观看| 妞干网免费视频观看| 亚洲AV无码男人的天堂| 国产免费AV片无码永久免费| 精品在线视频免费| 国产精品xxxx国产喷水亚洲国产精品无码久久一区 | 亚洲成A人片在线观看中文| 美女被爆羞羞网站免费| 亚洲人午夜射精精品日韩| 99久久免费国产精精品| 97亚洲熟妇自偷自拍另类图片| 99热这里只有精品6免费| 亚洲乱码中文字幕小综合| a级毛片无码免费真人| 国产91成人精品亚洲精品| 亚洲日韩精品无码专区网站| 人妻免费一区二区三区最新| 久久精品国产亚洲77777| 日韩av无码成人无码免费| 亚洲av无码无线在线观看| 亚洲区小说区图片区QVOD| 99re6在线视频精品免费下载| 亚洲乱码一二三四区乱码| 免费大香伊蕉在人线国产 | 亚洲视频免费在线观看| 亚洲国产成人九九综合| 国产99视频精品免费视频7| A毛片毛片看免费| 亚洲人成在线播放| 亚洲av午夜成人片精品电影 | 免费A级毛片无码免费视| 国产亚洲精品美女久久久久| 国产亚洲欧洲精品| 无码免费午夜福利片在线| 一级特黄a大片免费| 亚洲国产成人精品无码一区二区|