Maybe I should add that I also tried to do it the old-fashion way by the
Action-conversion.properties-file and of course my Bean-class has a
default no-arg constructor.

-----Original Message-----
From: Daniel Pfeifer [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 04, 2007 11:40 AM
To: user@struts.apache.org
Subject: DefaultObjectTypeDeterminer never invoked. Why??

I've got a problem which I suspect depends on some issue with
configuration.

I have an Action-class:

public class ClassifyFieldsAction extends ActionSupport {
    private String templateGroup;
    @KeyProperty(value = "name")           // have tried to have these
annotations on the property-methods, also
    @CreateIfNull(value = true)
    @Element(value = ClassifyFieldsFormBean.class)
    private List classifyFieldsFormBeans = new ArrayList();

    public List getClassifyFieldsFormBeans() {
        return classifyFieldsFormBeans;
    }

    public void setClassifyFieldsFormBeans(List classifyFieldsFormBeans)
{
        this.classifyFieldsFormBeans = classifyFieldsFormBeans;
    }

    public String execute() throws Exception {
       ClassifyFieldsFormBean o;
       o = new ClassifyFieldsFormBean("one", 1);
       classifyFieldsFormBeans.add(o);
       o = new ClassifyFieldsFormBean("two", 2);
       classifyFieldsFormBeans.add(o);

       return SUCCESS;
    }
}

A JSP:

...
<s:form>
<s:iterator name="classifyFieldsFormBeans" id="bean">
                <s:textfield
name="classifyFieldsFormBeans(%{bean.name}).name" readonly="true"/><br/>
                <s:textfield
name="classifyFieldsFormBeans(%{bean.name}).number"/><br/>
</s:iterator>
...
</s:form>

And the ClassifyFieldsFormBean.java looks like this:

public class ClassifyFieldsFormBean implements Serializable {
   private String name;
   private Integer number;

   ... getters and setters and a constructor here
}



I followed the example posted on the Struts 2-page, however, the I get
the right number of textfields but they are not filled in. I also set a
break-point in the DefaultObjectTypeDeterminer and it's never invoked
for some reason.

Does anybody have an idea why?

/D

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to