简体   繁体   中英

Rendering a GSP in grails as PDF via a Quartz Job problems

Has anyone had success in Grails 1.3.7 rendering gsps inside a quartz job?

I'm having a tough time getting it to work, tried various options including the template engine plugin, and the renderer plugin.

The Grailstemplateengine plugin doesn't get far at all, when the call is made to render, I get:

 No signature of method: GrailsTemplateEngineService.renderWithTemplateEngine() is applicable for argument types: (java.lang.String, java.util.LinkedHashMap) values: [/reports/templates/product_summary, [model:net.dbws.ieur.ProductSummaryModel@356eb0]]

Renderer plugin looks to be getting the furtherest except it seems to not control its own output correctly, calling pdfRenderingService() appears to be outputting the rendered PDF to standard out, as I'm seeing the content output in the IDE's output window, rather than rednering to its own byte array. And its raising an exception as its doing some kind of illegal cast as mixed in the output I can see 'java.io.ByteArrayOutputStream' to class 'java.lang.Number' [See nested exception: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object '%PDF-1.4'

So if anyone had success rendered gsps from within a quartz job, i'd love to know how you did it.

Thanks,

确定发现问题...。grails模板引擎的文档完全过时且不正确..它应该一直在调用“ renderView”而不是renderWithTemplateEngine

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM