Hi all,
I know this issue has been brought up in the past but I have not yet seen a solution. I want to register a String to String Webflow converter so that I can trim white space before binding to the model.
Putting a breakpoint in the method below shows me that when binding a String to an int (for example) Ognl.setValue(...) will invoke the conversationService.executeConversion(...) method. However this method will not be invoked when binding a String to a String.
In org.springframework.binding.expression.ognl.OgnlEx pression
I haven't been able to find the source code for OGNL version 2.6.9 so I'm having a little difficulty finding out where exactly OGNL is ignoring the conversionService.Code:public void setValue(Object context, Object value) { try { Map evaluationContext = Ognl.addDefaultContext(context, getVariables(context)); Ognl.setTypeConverter(evaluationContext, createTypeConverter()); Ognl.setValue(expression, evaluationContext, context, value); } catch (NoSuchPropertyException e) { throw new PropertyNotFoundException(context.getClass(), getExpressionString(), e); } catch (OgnlException e) { if (e.getReason() instanceof ValueCoercionException) { throw (ValueCoercionException) e.getReason(); } else { throw new EvaluationException(context.getClass(), getExpressionString(), "An OgnlException occurred setting the value of expression '" + getExpressionString() + "' on context [" + context.getClass() + "] to [" + value + "]", causeFor(e)); } } }
Has anyone come across any solution to trimming white space from parameters before binding to the model?


Reply With Quote
