Hi guys,
I've been reading this thread back and forth and all info I could find elsewhere about custom converters in Spring. It seems like everyone here has/had similar problems only I can't find a solution for my specific case. I must still be missing something. I get this error:
org.springframework.binding.convert.ConversionExec utorNotFoundException:
Custom ConversionExecutor with id 'userToString' cannot convert from sourceClass [nl.coremail.User] to targetClass [java.lang.String]
My converter userToString is found but spring thinks it can't do the required conversion.
this is my converter:
Code:
public class UserToString extends StringToObject {
public UserToString() {
super(String.class);
}
@Override
public Object toObject(String arg0, Class arg1) throws Exception {
return new User();
}
@Override
public String toString(Object arg0) throws Exception {
return "";
}
}
my conversion service:
Code:
@Component("webflowConversionService")
public class ApplicationConversionService extends DefaultConversionService {
@Override
protected void addDefaultConverters() {
super.addDefaultConverters();
addConverter("userToString", new UserToString());
}
}
webflow config contains:
Code:
<webflow:flow-builder-services id="flowBuilderServices" conversion-service="webflowConversionService" development="true" />
<webflow:flow-registry id="flowRegistry" base-path="/WEB-INF/flows" flow-builder-services="flowBuilderServices">
<webflow:flow-location-pattern value="/**/*-flow.xml" />
</webflow:flow-registry>
flow contains:
Code:
<view-state id="editContact" model="contact">
<binder>
<binding property="user" converter="userToString" required="true" />
</binder>
...
jsp contains:
Code:
<form:input path="user" />
Can anyone please give me a hand?
Spring 3, also tried 2.5.6.SEC01
Webflow 2.0.8