Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rxjava-groovy - scala - Template not found exception #18

Open
fupelaqu opened this issue Dec 4, 2014 · 0 comments
Open

rxjava-groovy - scala - Template not found exception #18

fupelaqu opened this issue Dec 4, 2014 · 0 comments

Comments

@fupelaqu
Copy link

fupelaqu commented Dec 4, 2014

Hi,

I am not sure if this issue is related to grails-rendering, anyway when I tried to generate a pdf I always got an UnknownTemplateException (grails.plugin.rendering.document.UnknownTemplateException: Could not find template for '/test')

My template is located in /grails-app/views/_test.gsp and pdfRenderingService is called within a method "test" this way

            Future<Collection<XXX>> futureResult = ...
            ...
            futureResult.onComplete({scala.util.Try<Collection<XXX>> t ->
                Collection<XXX> coll = t.get()
                coll.each { item ->
                    try{
                        test(item)
                    }
                    catch(Throwable th){
                        log.error(th.message, th)
                    }
                }
            } as Function1, ec)

    void test(XXX item){
        ...
        final template = "/test"
        def bos = new ByteArrayOutputStream()
        pdfRenderingService?.render([template: template, model:model], bos)
        ...
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant