Form and Java Model class in Struts 2

When the user submits a form you can bind the form to Java model class in Struct 2. We will see how to do it
First we will create the model class User.Java

Then you can create the jsp file to have the form. I am going to create a jsp file names person.jsp and I will add following code to it

Then you can create the TestAction.Java classs which will have refernce to your User bean class and ececute method

Finally you can update your struts.xml file