views:

116

answers:

1

G'day all,

I've been processing dynamic GSP content via tags in my own taglib which works just fine using code like:

    def GroovyPagesTemplateEngine groovyPagesTemplateEngine
...
    def processGSPContent(model, name, out) {
        log.debug("model is $model")
        Template t = groovyPagesTemplateEngine.createTemplate(model.content, name + ".gsp")
        Writable w = t.make(model: model)
        w.writeTo(out)
    }

Now I'm not 100% sure on how various resources like taglibs are found, but all my taglibs work fine as do the normal grails libs.

The problem I have is that AcegiSecurity's tags aren't found in content processed this way: e.g.

<g:isLoggedIn>
   You're logged in :-)
</g:isLoggedIn>

so how do I get GroovyPagesTemplateEngine to find the AcegiSecurity tags? I'm guessing it may be something to do with ApplicationContext or ServletContext.

edit--- Looks like it might be an overloaded namespace problem:

    Caused by: org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException: Tag [ifnotloggedin] does not exist. 
No tag library found for namespace: g at home_pmcneil_devel_Groupie_grails_app_views_display_page_gsp.run(home_pmcneil_devel_Groupie_grails_app_views_display_page_gsp:32)
A: 

The taglib does exist the problem was that the library I use to clean up the html quite rightly converts the tags to lowercase since html is not case sensitive. The trouble with that is that grails tags are case sensitive, so the tag "isLoggedIn" is not found.

pmc