struts2 ModelDriven update

public class ContactAction extends ActionSupport implements ModelDriven<Contact> {
    private static final long serialVersionUID = -2318419860549968641L;

    private TextProvider textProvider;
    private UserServices userServices;
    private ContactServices contactServices;

    private int cid;
    private Contact contact = new Contact();

 

 

@SkipValidation
    public String loadForUpdate() {
        Contact acontact = contactServices.read(contact.getId());

        BeanUtils.copyProperties(acontact, contact);//work
        return Action.SUCCESS;
    }

 

直接contact = contactServices.read(contact.getId());//not work

在update页面上表单的值显示不出来

你可能感兴趣的:(struts2)