public class DefaultTagErrorRendererFactory extends 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 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 String RENDERER_CLASS_KEY
public void init(Configuration configuration) throws Exception
init in interface ConfigurableComponentconfiguration - the Configuration object being used by StripesException - 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 TagErrorRendererFactorytag - The tag that needs to be error renderedprotected Configuration getConfiguration()
protected void setConfiguration(Configuration configuration)
© Copyright 2005-2006, Stripes Development Team.