struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Boon Leng <kb...@hotmail.com>
Subject [S2] Type Coversion in nested bean.
Date Wed, 29 Aug 2007 11:17:23 GMT

Hi,

I'm able to use type conversion to populate bean into List in the Action.
But when I tried to populate bean into a List nested inside another bean, is
not working and there's no error printed.
May I know how can I implement type conversion for nested bean?
Any help would be appreciated. Thanks.
The following is my code.

Action
-------------------
public class UserAction  extends ActionSupport {

    private User user;
    ...
}

Bean
-------------------
public class User {
    private Set<Role> roles = new HashSet<Role>();

    public Set<Role> getRoles() {
        return roles;
    }

    public void setRoles(Set<Role> value) {
        this.roles = value;
    }

    ...
}

JSP
-------------------
<s:optiontransferselect theme="simple"
	name="roleOptions.value" list="roleOptions" listKey="value"
listValue="label"
	doubleName="user.roles.id" doubleList="user.roles" doubleListKey="id"
doubleListValue="name"/>

SampleAction-coversion.properties
-------------------
Element_user.roles=sample.model.Role
KeyProperty_user.roles=id
CreateIfNull_user.roles=true


Regards,
Boon Leng
-- 
View this message in context: http://www.nabble.com/-S2--Type-Coversion-in-nested-bean.-tf4347142.html#a12385079
Sent from the Struts - User mailing list archive at Nabble.com.


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


Mime
View raw message