commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rodrigo Partearroyo <>
Subject [Betwixt] Customizing Vector binding with dot betwixt file
Date Tue, 26 Jul 2005 16:25:18 GMT
I´m trying to serialize a Vector of Strings. They are the security-roles
allowed to access some part of my webapp. The output i need is this:

    <security-role rol="rol1" />
    <security-role rol="rol2" />
    <security-role rol="rol3" />
    <security-role rol="rol4" />

but all i can obtain is this:

    <security-role rol="[rol1, rol2, rol3, rol4]"/>

The bean i'm using is :

public class SecurityRolesBean {
    private Vector rolesList;
    public SecurityRolesBean (){
        rolesList = new Vector();
    public Vector getRolesList(){
        return rolesList;
    public void setServiceRole(String role){
    private void setRolesList(String rol){

and the dot betwixt file:

<?xml version="1.0"?>
    <element name="security-roles">
    <element name="security-role">
        <attribute name='rol' property='rolesList'/>

The question is: How can i put each of the Vector's elements (which are
Strings) in separate xml elements?

The inverse step (populating the Bean with data read from a xml file) is
done with Digester following this rule:

<pattern value="security-role">
        <alias attr-name="rol" prop-name="serviceRole" />

Due to Digester cannot perform the inverse operation (writting beans to
xml files) i´m trying to move it to Betwixt, but the xml format cannot

Thanks in advance.

Rodrigo Partearroyo González

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message