jijo-paulose / zkgrails

Automatically exported from code.google.com/p/zkgrails
1 stars 0 forks source link

RequestContextHolder always return null #341

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The getAttributes() method in 
org.springframework.web.context.request.RequestContextHolder is used to 
determine if the current thread is associated to a Web request.

But after upgraded to grails 2.2.1 and the latest version of the zkgrails 
plugin the method always returns null. 

Original issue reported on code.google.com by chanwit on 31 Jul 2013 at 10:27

GoogleCodeExporter commented 9 years ago
This code is working fine so far:

{{{
class Issue341Composer extends zk.grails.Composer {

    def afterCompose = { wnd ->
        RequestAttributes cra = RequestContextHolder.currentRequestAttributes()
        def globals  = cra.getAttributeNames(RequestAttributes.SCOPE_GLOBAL_SESSION)
        def requests = cra.getAttributeNames(RequestAttributes.SCOPE_REQUEST)
        def sessions = cra.getAttributeNames(RequestAttributes.SCOPE_SESSION)

        if (globals != null && requests != null && sessions != null) {
            $('#test').text('OK')
        }
    }

}

}}}

Original comment by chanwit on 3 Aug 2013 at 5:13

GoogleCodeExporter commented 9 years ago
Closed as wont fix.

Original comment by chanwit on 21 Aug 2013 at 1:14