spring-webflow icon indicating copy to clipboard operation
spring-webflow copied to clipboard

Attach Converter to property path [SWF-924]

Open spring-operator opened this issue 17 years ago • 0 comments

eli willaert opened SWF-924 and commented

A propertyEditor can be attached to a certain property path of a bean, this allows for a very flexible conversion strategy. With the new conversionservice and converter implementations this is only possible in the flow definition and not with a programmatic approach like with the propertyEditorRegistrar.

Example:

User{ @Mask(pattern = "ddd.ddd.dd") public String getBankAccountNumber(); }

In webflow 1.0 we had a PropertyEditorRegistrar that automatically add's a MaskPropertyEditor for each bean path with the Mask annotation. This made it possible to automatically render the properties with the correct mask and removed the masked when binding.

In webflow 2 I could do it like this:

<binder> <binding property="bankAccountNumber" converter="mask"/> </binder>

But I would like to be able to configure this like the propertyEditorRegistrar so that I don't have to do this over and over again. I already defined the Mask in the source code so duplicating it in my flow definition is not very DRY.

Is it clear what I am trying to say?


Affects: 2.0 M1, 2.0 M2, 2.0 M3, 2.0 M4, 2.0.0.RC1, 2.0.0, 2.0.1, 2.0.2, 2.0.3

2 votes, 3 watchers

spring-operator avatar Oct 26 '08 22:10 spring-operator