|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.context.support.ApplicationObjectSupport org.springframework.web.context.support.WebApplicationObjectSupport org.springframework.web.servlet.view.AbstractView org.springframework.web.servlet.view.AbstractUrlBasedView org.codehaus.groovy.grails.web.servlet.view.GroovyPageView
public class GroovyPageView extends org.springframework.web.servlet.view.AbstractUrlBasedView
A Spring View that renders Groovy Server Pages to the response. It requires an instance of GroovyPagesTemplateEngine to be set and will render to view returned by the getUrl() method of AbstractUrlBasedView This view also requires an instance of GrailsWebRequest to be bound to the currently executing Thread using Spring's RequestContextHolder. This can be done with by adding the GrailsWebRequestFilter.
Field Summary | |
---|---|
static java.lang.String |
EXCEPTION_MODEL_KEY
|
protected groovy.text.Template |
template
|
protected GroovyPagesTemplateEngine |
templateEngine
|
Fields inherited from class org.springframework.web.servlet.view.AbstractUrlBasedView | |
---|---|
DEFAULT_CONTENT_TYPE, RESPONSE_STATUS_ATTRIBUTE, PATH_VARIABLES |
Fields inherited from class org.springframework.web.servlet.view.AbstractView | |
---|---|
DEFAULT_CONTENT_TYPE, RESPONSE_STATUS_ATTRIBUTE, PATH_VARIABLES |
Method Summary | |
---|---|
void
|
afterPropertiesSet()
|
static GroovyPagesException
|
createGroovyPageException(java.lang.Exception exception, GroovyPagesTemplateEngine engine, java.lang.String pageUrl)
|
protected GSPResponseWriter
|
createResponseWriter(javax.servlet.http.HttpServletResponse response)
Creates the Response Writer for the specified HttpServletResponse instance. |
protected void
|
handleException(java.lang.Exception exception, GroovyPagesTemplateEngine engine)
Performs exception handling by attempting to render the Errors view. |
protected void
|
initTemplate()
|
boolean
|
isExpired()
|
protected void
|
renderMergedOutputModel(java.util.Map model, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Delegates to renderMergedOutputModel(..) |
protected void
|
renderWithTemplateEngine(GroovyPagesTemplateEngine engine, java.util.Map model, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpServletRequest request)
Replaces the requirement for "super.exposeModelAsRequestAttributes(model, request);" in renderMergedOutputModel. |
void
|
setScriptSource(org.springframework.scripting.ScriptSource scriptSource)
|
void
|
setTemplateEngine(GroovyPagesTemplateEngine templateEngine)
|
Methods inherited from class org.springframework.web.servlet.view.AbstractUrlBasedView | |
---|---|
org.springframework.web.servlet.view.AbstractUrlBasedView#toString(), org.springframework.web.servlet.view.AbstractUrlBasedView#checkResource(java.util.Locale), org.springframework.web.servlet.view.AbstractUrlBasedView#getUrl(), org.springframework.web.servlet.view.AbstractUrlBasedView#setUrl(java.lang.String), org.springframework.web.servlet.view.AbstractUrlBasedView#afterPropertiesSet(), org.springframework.web.servlet.view.AbstractUrlBasedView#getContentType(), org.springframework.web.servlet.view.AbstractUrlBasedView#setContentType(java.lang.String), org.springframework.web.servlet.view.AbstractUrlBasedView#render(java.util.Map, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), org.springframework.web.servlet.view.AbstractUrlBasedView#setAttributes(java.util.Properties), org.springframework.web.servlet.view.AbstractUrlBasedView#getBeanName(), org.springframework.web.servlet.view.AbstractUrlBasedView#setBeanName(java.lang.String), org.springframework.web.servlet.view.AbstractUrlBasedView#setRequestContextAttribute(java.lang.String), org.springframework.web.servlet.view.AbstractUrlBasedView#getRequestContextAttribute(), org.springframework.web.servlet.view.AbstractUrlBasedView#setAttributesCSV(java.lang.String), org.springframework.web.servlet.view.AbstractUrlBasedView#addStaticAttribute(java.lang.String, java.lang.Object), org.springframework.web.servlet.view.AbstractUrlBasedView#setAttributesMap(java.util.Map), org.springframework.web.servlet.view.AbstractUrlBasedView#getAttributesMap(), org.springframework.web.servlet.view.AbstractUrlBasedView#getStaticAttributes(), org.springframework.web.servlet.view.AbstractUrlBasedView#setExposePathVariables(boolean), org.springframework.web.servlet.view.AbstractUrlBasedView#isExposePathVariables(), org.springframework.web.servlet.view.AbstractUrlBasedView#setServletContext(javax.servlet.ServletContext), org.springframework.web.servlet.view.AbstractUrlBasedView#setApplicationContext(org.springframework.context.ApplicationContext), org.springframework.web.servlet.view.AbstractUrlBasedView#getApplicationContext(), org.springframework.web.servlet.view.AbstractUrlBasedView#wait(), org.springframework.web.servlet.view.AbstractUrlBasedView#wait(long), org.springframework.web.servlet.view.AbstractUrlBasedView#wait(long, int), org.springframework.web.servlet.view.AbstractUrlBasedView#equals(java.lang.Object), org.springframework.web.servlet.view.AbstractUrlBasedView#hashCode(), org.springframework.web.servlet.view.AbstractUrlBasedView#getClass(), org.springframework.web.servlet.view.AbstractUrlBasedView#notify(), org.springframework.web.servlet.view.AbstractUrlBasedView#notifyAll() |
Methods inherited from class org.springframework.web.servlet.view.AbstractView | |
---|---|
org.springframework.web.servlet.view.AbstractView#toString(), org.springframework.web.servlet.view.AbstractView#getContentType(), org.springframework.web.servlet.view.AbstractView#setContentType(java.lang.String), org.springframework.web.servlet.view.AbstractView#render(java.util.Map, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), org.springframework.web.servlet.view.AbstractView#setAttributes(java.util.Properties), org.springframework.web.servlet.view.AbstractView#getBeanName(), org.springframework.web.servlet.view.AbstractView#setBeanName(java.lang.String), org.springframework.web.servlet.view.AbstractView#setRequestContextAttribute(java.lang.String), org.springframework.web.servlet.view.AbstractView#getRequestContextAttribute(), org.springframework.web.servlet.view.AbstractView#setAttributesCSV(java.lang.String), org.springframework.web.servlet.view.AbstractView#addStaticAttribute(java.lang.String, java.lang.Object), org.springframework.web.servlet.view.AbstractView#setAttributesMap(java.util.Map), org.springframework.web.servlet.view.AbstractView#getAttributesMap(), org.springframework.web.servlet.view.AbstractView#getStaticAttributes(), org.springframework.web.servlet.view.AbstractView#setExposePathVariables(boolean), org.springframework.web.servlet.view.AbstractView#isExposePathVariables(), org.springframework.web.servlet.view.AbstractView#setServletContext(javax.servlet.ServletContext), org.springframework.web.servlet.view.AbstractView#setApplicationContext(org.springframework.context.ApplicationContext), org.springframework.web.servlet.view.AbstractView#getApplicationContext(), org.springframework.web.servlet.view.AbstractView#wait(), org.springframework.web.servlet.view.AbstractView#wait(long), org.springframework.web.servlet.view.AbstractView#wait(long, int), org.springframework.web.servlet.view.AbstractView#equals(java.lang.Object), org.springframework.web.servlet.view.AbstractView#hashCode(), org.springframework.web.servlet.view.AbstractView#getClass(), org.springframework.web.servlet.view.AbstractView#notify(), org.springframework.web.servlet.view.AbstractView#notifyAll() |
Field Detail |
---|
public static final java.lang.String EXCEPTION_MODEL_KEY
protected groovy.text.Template template
protected GroovyPagesTemplateEngine templateEngine
Method Detail |
---|
@Override public void afterPropertiesSet()
public static GroovyPagesException createGroovyPageException(java.lang.Exception exception, GroovyPagesTemplateEngine engine, java.lang.String pageUrl)
protected GSPResponseWriter createResponseWriter(javax.servlet.http.HttpServletResponse response)
response
- The HttpServletResponse instance
protected void handleException(java.lang.Exception exception, GroovyPagesTemplateEngine engine)
exception
- The exception that occuredengine
- The GSP engine
@SuppressWarnings("unused") protected void initTemplate()
public boolean isExpired()
@SuppressWarnings({ "unchecked", "rawtypes" }) @Override protected final void renderMergedOutputModel(java.util.Map model, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
model
- The view modelrequest
- The HttpServletRequestresponse
- The HttpServletResponse
@SuppressWarnings({ "rawtypes", "unused" }) protected void renderWithTemplateEngine(GroovyPagesTemplateEngine engine, java.util.Map model, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpServletRequest request)
public void setScriptSource(org.springframework.scripting.ScriptSource scriptSource)
public void setTemplateEngine(GroovyPagesTemplateEngine templateEngine)
Groovy Documentation