How to specify the correct bean reflexes when I use the Abstrarct factory method template with Spring.
I get constructor argument errors on Spring dispatcher-servlet.xml.
errors:
Ambiguous argument types of the factory method - did you specify the correct bean references as arguments to the factory method?
short dispatcher-servlet.xml
<bean id="myFactory" class="cwsei.spring.dao.CategoryFactory" factory-method="findCategory">
<constructor-arg type="java.lang.Enum" value="${categoryType}" />
</bean>
Here is my code:
public abstract class Category {
public abstract List list(int departId);
..
}
public class CategoryFactory {
public enum CategoryType { firstclass,secondClass,...}
public static Category findCategory(CategoryType categoryType) {
...
}
}
Thanks mkohan
source
share