I have a class Stk with property warType of type enum WarrType

    public enum WarrType {
        NONE, CALL, PUT; }

I have in my struts config

<form-bean name="MyForm"
type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="warType" type="java.lang.String"/>

and in my Action

   MyConverter mc = new MyConverter();
   ConvertUtils.register(mc, WarrType.class);
   PropertyUtils.copyProperties(stk, form);
   ...... 
and embedded in the Action class

   public class MyConverter implements Converter {
   @Override
   public WarrType convert(Class c, Object s) {
        WarrType result = null;
         System.out.println("I am running");
         if (s.equals("NONE")) result = WarrType.NONE;
        return result; ....

The problem is the convert() never executed. the copyProperties failed with
"...had String ... expect WarrType...". Any idea why?

-- 
View this message in context: 
http://www.nabble.com/-Struts-1.3--first-time-use-custom-converter-not-working-tp25531027p25531027.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to