Grails get Session and Management in Service class

前端 未结 4 1719
囚心锁ツ
囚心锁ツ 2021-02-04 04:11

I have a problem with Grails Session. I was thinking about having a Service Class for my session handling. So I created a class called \"SessionService\" (under grails-app/servi

4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-04 04:52

    This also works

    import grails.web.api.ServletAttributes
    
    @Transactional
    class AuthService implements ServletAttributes {
    
       // session will be available
    

提交回复
热议问题