|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.codehaus.groovy.grails.scaffolding.TemplateGeneratingResponseHandler
public class TemplateGeneratingResponseHandler
A response handler that uses a GroovyPageTemplateEngine instance to write Templates directly to the response. Also requires a reference to the ViewResolver to establish whether a view already exists for the response, in which case it delegates to the view.
ViewResolver
,
GrailsViewResolver
,
GroovyPagesTemplateEngine
Constructor Summary | |
---|---|
TemplateGeneratingResponseHandler()
|
Method Summary | |
---|---|
void |
clearViewCache()
Clears the cache of generated views. |
protected ModelAndView |
createScaffoldedResponse(String uri,
Map model,
String actionName)
Takes the given URI and model and either retrieves a cached view or generates and places the generated view into a ScaffoldedGroovyPageView instance |
ModelAndView |
handleResponse(HttpServletRequest request,
HttpServletResponse response,
String actionName,
Map model)
Either delegates to a pre-existing view or renders an in-memory scaffolded view to the response |
void |
setApplicationContext(ApplicationContext applicationContext)
|
void |
setGrailsApplication(GrailsApplication grailsApplication)
|
void |
setScaffoldedClass(Class scaffoldedClass)
|
void |
setTemplateGenerator(GrailsTemplateGenerator templateGenerator)
Sets the Scaffolding GrailsTemplateGenerator to use when generating templates |
void |
setViewResolver(ViewResolver resolver)
Sets the ViewResolver this ResponseHandler should use to resolve pre-existing views |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TemplateGeneratingResponseHandler()
Method Detail |
---|
public void clearViewCache()
public ModelAndView handleResponse(HttpServletRequest request, HttpServletResponse response, String actionName, Map model)
handleResponse
in interface ScaffoldResponseHandler
request
- The HttpServletRequestresponse
- The HttpServletResponseactionName
- The name of the action to handlemodel
- The View model
protected ModelAndView createScaffoldedResponse(String uri, Map model, String actionName)
uri
- The URI of the viewmodel
- The model of the viewactionName
-
public void setViewResolver(ViewResolver resolver)
setViewResolver
in interface ScaffoldResponseHandler
resolver
- The ViewResolverpublic void setTemplateGenerator(GrailsTemplateGenerator templateGenerator)
templateGenerator
- The GrailsTemplateGenerator instancepublic void setScaffoldedClass(Class scaffoldedClass)
public void setGrailsApplication(GrailsApplication grailsApplication)
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
setApplicationContext
in interface ApplicationContextAware
BeansException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |