public abstract class RenderServiceTag
extends org.springframework.web.servlet.tags.RequestContextAwareTag
An abstract RequestContextAwareTag intended to be sub-classed by custom JSP tags that
require access to a RenderService for rendering Spring Surf objects (such as pages,
templates, components, etc). It extends the Spring provided RequestContextAwareTag class
in order to access the WebApplicationContext from which to retrieve a RenderService
interface implementing bean. If no bean is found then the JSP will render an error message indicating
the cause of the problem (ideally this will be detected during development rather than in product release). If
more than one RenderService is found then it will use the first that is a
RenderServiceImpl instance, and if one is not found will simply use the first bean
retrieved.
Although the Spring Surf defines a RenderServiceImpl with a known bean id, it is not
directly looked up because this would prevent alternative services being set through custom configuration.
To ensure that an alternative RenderService from the default Spring Surf configured bean is used you
must override the default bean (that is re-use the bean id: "webframework.service.render").
| Constructor and Description |
|---|
RenderServiceTag() |
| Modifier and Type | Method and Description |
|---|---|
protected int |
doStartTagInternal()
Attempts to find a
RenderService bean to provide to subclasses to use for rendering. |
protected abstract int |
invokeRenderService(RenderService renderService,
RequestContext renderContext,
ModelObject object)
This method should be implemented to invoke the required method of the
RenderService
that the subclass needs to render its output |
doCatch, doFinally, doStartTag, getRequestContextprotected final int doStartTagInternal()
throws Exception
Attempts to find a RenderService bean to provide to subclasses to use for rendering.
If no RenderService bean is defined in then an error message will be rendered without
invoking any subclass code. If more than one RenderService is found then it will attempt
to use the default Spring Surf implementation. Failing that it will use the first RenderService
bean found.
doStartTagInternal in class org.springframework.web.servlet.tags.RequestContextAwareTagExceptionprotected abstract int invokeRenderService(RenderService renderService, RequestContext renderContext, ModelObject object) throws Exception
This method should be implemented to invoke the required method of the RenderService
that the subclass needs to render its output
renderService - RenderServicerenderContext - RequestContextobject - ModelObjectExceptionCopyright © 2005–2016 Alfresco Software. All rights reserved.