public class DefaultPopulationStrategy extends java.lang.Object implements PopulationStrategy
Default implementation of the form input tag population strategy. First looks to see if there is a parameter with the same name as the tag submitted in the current request. If there is, it will be returned as a String[] in order to support multiple-value parameters.
If there is no value in the request then an ActionBean bound to the current form will be looked for. If the ActionBean is found and the value is non-null it will be returned. If no value can be found in either place, null will returned.
Constructor and Description |
---|
DefaultPopulationStrategy() |
Modifier and Type | Method and Description |
---|---|
protected Configuration |
getConfiguration()
Accessor for the configuration supplied when the population strategy is initialized.
|
java.lang.Object |
getValue(InputTagSupport tag)
Implementation of the interface method that will follow the search described in the class
level JavaDoc and attempt to find a value for this tag.
|
protected java.lang.Object |
getValueFromActionBean(InputTagSupport tag)
Helper method that will check to see if there is an ActionBean present in the request,
and if so, retrieve the value for this tag from the ActionBean.
|
protected java.lang.Object |
getValueFromTag(InputTagSupport tag)
Helper method that will retrieve the preferred value set on the tag in the JSP.
|
protected java.lang.String[] |
getValuesFromRequest(InputTagSupport tag)
Helper method that will check the current request for user submitted values for the
tag supplied and return them as a String[] if there is one or more present.
|
void |
init(Configuration configuration)
Called by the Configuration to configure the component.
|
protected boolean |
isFormInError(InputTagSupport tag)
Helper method that will check to see if the form containing this tag is being rendered
as a result of validation errors.
|
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.protected Configuration getConfiguration()
public java.lang.Object getValue(InputTagSupport tag) throws StripesJspException
getValue
in interface PopulationStrategy
tag
- the form input tag whose value to populateStripesJspException
protected java.lang.String[] getValuesFromRequest(InputTagSupport tag) throws StripesJspException
tag
- the tag whose values to look forStripesJspException
protected java.lang.Object getValueFromActionBean(InputTagSupport tag) throws StripesJspException
tag
- the tag whose values to look forStripesJspException
protected java.lang.Object getValueFromTag(InputTagSupport tag)
tag
- the tag that is being repopulatedprotected boolean isFormInError(InputTagSupport tag) throws StripesJspException
tag
- the tag that is being repopulatedStripesJspException
? Copyright 2005-2006, Stripes Development Team.