com.opensymphony.webwork.interceptor
Class BooleanTweaker

java.lang.Object
  extended by com.opensymphony.xwork.interceptor.AroundInterceptor
      extended by 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.

 

 
      
           
              ....
              
              
              ....
           
       

      
          
          ....
      
      ....
 

 
 

Version:
$Date$ $Id$
Author:
k.pribluda
See Also:
Serialized Form

Field Summary
static String FALSE
           
static String PREFIX
           
 
Fields inherited from class com.opensymphony.xwork.interceptor.AroundInterceptor
log
 
Constructor Summary
BooleanTweaker()
           
 
Method Summary
protected  void after(ActionInvocation arg0, String arg1)
          Do nothing.
protected  void before(ActionInvocation ai)
          Scan through the paramaters and find those with starts with getPrefix() and set their corresponding parameter with value from getBooleanValue().
 String getBooleanValue()
          Get the boolean value to set.
 String getPrefix()
          Get the prefix.
 void setBooleanValue(String booleanValue)
          Set the boolean value.
 void setPrefix(String prefix)
          Set the prefix.
 
Methods inherited from class com.opensymphony.xwork.interceptor.AroundInterceptor
destroy, init, intercept
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PREFIX

public static final String PREFIX
See Also:
Constant Field Values

FALSE

public static final String FALSE
See Also:
Constant Field Values
Constructor Detail

BooleanTweaker

public BooleanTweaker()
Method Detail

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

WebWork Project Page