I have an Action class that implements ModelDriven.

My DummyForm object will be used to store the user's input (just a userName
attribute in this case).


ValidateDummy ActionClass:
public class ValidateDummy implements ModelDriven{

    private DummyForm form;

    public String execute(){
        return INPUT;
    }

    public Object getModel(){
        if(form == null) 
            return new DummyForm();

        return form;
    }
} 


DummyForm:
public class DummyForm{
    private String userName;
    // getters and setters for userName..
}


dummyvalidate.jsp: (irrelevant parts removed)
<s:form method="post">
    <s:textfield name="userName" label="Enter User Name"/>
    <s:submit/>
</s:form>


After the user enters a user name and submits, the userName attribute inside
the form should be populated with the user's input, right? However, userName
remained null.

I have added a interceptor-ref to "model-driven" as well.

Am I missing any requirements here?
-- 
View this message in context: 
http://www.nabble.com/-S2--Unable-to-access-Model-properties-when-using-ModelDriven-tf3957353.html#a11228982
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to