public class DefaultTagErrorRendererFactory extends java.lang.Object implements TagErrorRendererFactory
A straightforward implementation of the TagErrorRendererFactory interface that looks
up the name of the renderer class in config, and if one is not supplied defaults to
using the DefaultTagErrorRenderer
. The same TagErrorRenderer is instantiated for
all tags, and must be public and have a public no-arg constructor.
To configure a different TagErrorRenderer use the configuration key
TagErrorRenderer.Class
and supply a fully qualified class name. For example, to
do this in web.xml you would add the following parameter to the Stripes Filter:
<init-param> <param-name>TagErrorRenderer.Class</param-name> <param-value>com.myco.web.util.CustomTagErrorRenderer</param-value> </init-param>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
RENDERER_CLASS_KEY |
Constructor and Description |
---|
DefaultTagErrorRendererFactory() |
Modifier and Type | Method and Description |
---|---|
protected Configuration |
getConfiguration() |
TagErrorRenderer |
getTagErrorRenderer(InputTagSupport tag)
Returns a new instance of the configured renderer that is ready for use.
|
void |
init(Configuration configuration)
Looks up the name of the configured renderer class in the configuration and
attempts to find the Class object for it.
|
protected void |
setConfiguration(Configuration configuration) |
public static final java.lang.String RENDERER_CLASS_KEY
public void init(Configuration configuration) throws java.lang.Exception
init
in interface ConfigurableComponent
configuration
- the Configuration object being used by Stripesjava.lang.Exception
- should be thrown if the component cannot be configured well enough to use.public TagErrorRenderer getTagErrorRenderer(InputTagSupport tag)
DefaultTagErrorRenderer
. If a custom class is configured
and cannot be instantiated, an exception will be thrown.getTagErrorRenderer
in interface TagErrorRendererFactory
tag
- The tag that needs to be error renderedprotected Configuration getConfiguration()
protected void setConfiguration(Configuration configuration)
? Copyright 2005-2006, Stripes Development Team.