com.opensymphony.webwork.interceptor
Class BooleanTweaker
java.lang.Object
com.opensymphony.xwork.interceptor.AroundInterceptor
com.opensymphony.webwork.interceptor.BooleanTweaker
- All Implemented Interfaces:
- Interceptor, Serializable
public class BooleanTweaker - extends AroundInterceptor
Interceptor tweaking boolean parameters. parameters with names
starting by PREFIX will be stripped of it, and if no value is available under
stripped name explicitely set to false.
This helps to overcome problem with boolean checkboxes ( unchecked value is not sent
by browser )
To be used before ParametersInterceptor.
No known extension points.
- prefix - The prefix that identify the parameter whose corresponding property will be set to false (by default).
Default to '_FALSE_.'
- booleanValue - The boolean value to be set (default to 'false')
....
....
....
....
- Version:
- $Date$ $Id$
- Author:
- k.pribluda
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PREFIX
public static final String PREFIX
- See Also:
- Constant Field Values
FALSE
public static final String FALSE
- See Also:
- Constant Field Values
BooleanTweaker
public BooleanTweaker()
setBooleanValue
public void setBooleanValue(String booleanValue)
- Set the boolean value.
- Parameters:
booleanValue -
getBooleanValue
public String getBooleanValue()
- Get the boolean value to set.
- Returns:
- String
setPrefix
public void setPrefix(String prefix)
- Set the prefix.
- Parameters:
prefix -
getPrefix
public String getPrefix()
- Get the prefix.
- Returns:
- String
after
protected void after(ActionInvocation arg0,
String arg1)
throws Exception
- Do nothing.
- Specified by:
after in class AroundInterceptor
- Parameters:
arg0 - arg1 -
- Throws:
Exception
before
protected void before(ActionInvocation ai)
throws Exception
- Scan through the paramaters and find those with starts with
getPrefix() and set
their corresponding parameter with value from getBooleanValue().
Eg, parameter myBoolean will have myBoolean property set to false.
- Specified by:
before in class AroundInterceptor
- Parameters:
ai -
- Throws:
Exception
|