public class GrailsSiteMeshViewContext extends SiteMeshViewContext
Grails-flavoured SiteMeshViewContext that pushes a fresh
Sitemesh3CapturedPage onto the request for the duration of each
decorator dispatch. The layout GSP's own capture taglibs populate that
page, which CaptureAwareContentProcessor then returns as the
decorated Content (enabling chained decoration without a second
HTML parse).
Overrides dispatch to route absolute paths (those starting with
/) through the ViewResolver rather than falling back to
RequestDispatcher.forward(). All Grails layout paths are absolute
(e.g. /layouts/application), but SiteMeshViewContext#dispatch#dispatch
only uses the ViewResolver for relative names — paths that start with /
are handed off to WebAppContext.dispatch() which re-enters the servlet
pipeline via a forward. Routing through the ViewResolver keeps decoration
entirely within the Spring MVC view-resolver chain and avoids re-entering
the filter stack.
| Constructor and description |
|---|
GrailsSiteMeshViewContext(java.lang.String contentType, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext, ContentProcessor contentProcessor, ResponseMetaData metaData, boolean includeErrorPages, ViewResolver viewResolver, java.util.Locale locale) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public void |
dispatch(HttpServletRequest request, HttpServletResponse response, java.lang.String path) |
|
public void |
setViewModel(java.util.Map<java.lang.String, ?> viewModel) |