public class MyAction extends ActionSupport implements ParameterNameAware {
/**
* This method will filter out parameters that
* start with "d-" followed by a numeric digit,
* because parameters of this form are generated by displayTag,
* and are treated by webwork as an invalid OGNL expressions causing
* webwork to throw an ognl.InappropriateExpressionException exception.
* Note that the exception is only thrown when webwork is set in devmode.
* However, to prevent this error, the ParameterNameAware interface has been
* implemented which requires this method.
* This method could be implemented more simply using java's regular expression
* support, but such an implementation may suffer from readability except for
* people who are very strong in understanding java's RegEX semantics.
*/
public boolean acceptableParameterName(String parameterName){
boolean retVal = true;
if(parameterName!=null && parameterName.startsWith("d-") )
if( parameterName.length()>2) {
String thirdCharacter = parameterName.substring(2,3);
if(StringUtils.isNumeric(thirdCharacter)){
retVal = false;
}
}
return retVal;
}
}