Search in sources :

Example 6 with UserDto

use of org.webpieces.webserver.basic.app.biz.UserDto in project webpieces by deanhiller.

the class BeansController method arrayForm.

public Action arrayForm() {
    UserDto user = new UserDto();
    //in which case you could add new UserDto as well
    for (int i = 0; i < 3; i++) {
        Account acc = new Account();
        if (i == 0)
            acc.setName("FirstAccName");
        else
            acc.setName("SecondAccName");
        user.getAccounts().add(acc);
        acc.getAddresses().add(null);
        Address address2 = new Address();
        address2.setStreet("someStreet2-" + i);
        acc.getAddresses().add(address2);
    }
    return Actions.renderThis("user", user);
}
Also used : Account(org.webpieces.webserver.tags.app.Account) Address(org.webpieces.webserver.basic.app.biz.Address) UserDto(org.webpieces.webserver.basic.app.biz.UserDto)

Aggregations

UserDto (org.webpieces.webserver.basic.app.biz.UserDto)6 Test (org.junit.Test)4 WebserverForTest (org.webpieces.webserver.WebserverForTest)4 AbstractWebpiecesTest (org.webpieces.webserver.test.AbstractWebpiecesTest)4 FullResponse (org.webpieces.webserver.test.FullResponse)4 HttpDummyRequest (org.webpieces.webserver.test.HttpDummyRequest)4 ByteBuffer (java.nio.ByteBuffer)1 BufferCreationPool (org.webpieces.data.api.BufferCreationPool)1 DataWrapper (org.webpieces.data.api.DataWrapper)1 DataWrapperGenerator (org.webpieces.data.api.DataWrapperGenerator)1 HttpParser (org.webpieces.httpparser.api.HttpParser)1 MarshalState (org.webpieces.httpparser.api.MarshalState)1 Address (org.webpieces.webserver.basic.app.biz.Address)1 Account (org.webpieces.webserver.tags.app.Account)1