import org.codehaus.groovy.grails.web.servlet.DefaultGrailsApplicationAttributes;
import org.codehaus.groovy.grails.commons.*
import grails.gsp.PageRenderer
import grails.gsp.ExtendedPageRenderer
class StandaloneContentGenerator {
def PageRenderer groovyPageRenderer
def generateContent() {
...
HashMap
map.put(DefaultGrailsApplicationAttributes.CONTROLLER_NAME_ATTRIBUTE, 'logEntry')
map.put(DefaultGrailsApplicationAttributes.APP_URI_ATTRIBUTE, 'http://host:port/App')
def content = new ExtendedPageRenderer(groovyPageRenderer, map).render(view: "/logEntry/list",
model: [logEntryInstanceList: results, logEntryInstanceTotal: results.size,
"flash.message": 'Content generated'])
return content
}
}
0 komentarze:
Prześlij komentarz