Hi Silvian,

you have to know the propertyname and write accessor-methods. Where should struts know, which property to put out?
Have a look at the jstl-core library.


Greets Mark


Sylvain ~ wrote:

Hi,

I wanted to create a Form Bean to represent a list of StorableObjects
with a filter bean nested inside in order to be able to handle
generically list display of Objects.

Here is my ListBean code :

public class ListBean extends ActionForm {

private ArrayList l;
private StorableObject filter;
public void setList(ArrayList l){
this.l = l;
}
public ArrayList getList(){
return l;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public StorableObject getFilter() {
return filter;
}
public void setFilter(StorableObject filter) {
this.filter = filter;
}
}


The objects are stored in the list property of the bean, and filter
parameters are stored in filter property.

The StorableObject Class is abstract, and thus doesn't have any
properties, implementing classes have such properties accessors. Form
population with the right class type is made at runtime by the action.

When submitting the filter form, I get a javax.servlet.ServletException: BeanUtils.populate exception, despite
I am able to display values populated by the action.


It seems that in this case Struts tries to populate a bean of type
StorableObject, and since this one is abstract it results in a error.

So, my question, is there a way to make struts use a generic form bean
with any properties names and values and then handle it by hand in the
action ?

Any input would be appreciated.
Sylvain.

---------------------------------------------------------------------
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