10:19 pm - Friday March 22, 2019

What is MVC In java with Example Program

Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044

Struts MVC Architecture: 



The model contains the business logic and interacts with the persistence storage to store, retrieve and manipulate data.


The view is responsible for display the results back to the user. In Struts the view layer is implemented using JSP.


The controller handles all the request from the user and selects the appropriate view to return. In Struts the controller’s job is done by the  ActionServlet.

The following Process happen when the Client browser hits an HTTP request.

  1. The ActionServlet  receives the request.

  2. The struts-config.xml  file controls the  ActionsActionForms, ActionMappings and ActionForwards.

  3. While executing the  ActionServelet  reads the struts-config.xml file and creates a database of configuration objects. Then processing the request the  ActionServlet  makes the decision by referring to this object.


After ActionServlet receives the request it does the following actions.

  1. JavaBean class which extends Struts ActionForm class.

  2. Decides which action class to invoke to process the request.

  3. Validate the data entered by the user.

  4. The action class process the request with the help of the model component. The model interacts with the database and process the request.

  5. Finally, the Action class returns an ActionForward to the controller.

  6. Depends on the ActionForward the controller will invoke the appropriate view

  7. The Final step is HTTP response is back to the user by the view component




Filed in: Z-AStruts Codes

No comments yet.

Leave a Reply