Question: How is the MVC design pattern used in Struts framework?

By: Guru Singh Printer Friendly Format    


Question: How is the MVC design pattern used in Struts framework?

Answer:  In the MVC design pattern, a central Controller mediates application flow. The Controller delegates requests to an appropriate handler. The handlers are tied to a Model, and each handler acts as an adapter between the request and the Model. The Model represents, or encapsulates, an application’s business logic or state. Control is usually then forwarded back through the Controller to the appropriate View. The forwarding can be determined by consulting a set of mappings, usually loaded from a database or configuration file. This provides a loose coupling between the View and Model, which can make an application significantly easier to create and maintain. Controller: Servlet controller which supplied by Struts itself; View: what you can see on the screen, a JSP page and presentation components; Model: System state and a business logic JavaBeans.

 

 

 

 


Most Viewed Articles (in Interview )

What is similarities/difference between an Abstract class and Interface?

What are the life-cycle methods of JSP?

Interview Question: Where can I get a copy of Struts?

Interview Question: What is ActionServlet?

Interview Question: What is Deployment descriptor?

Interview Question: Can I invoke Runtime.gc() in an EJB?

Interview Question: Why does EJB needs two interfaces(Home and Remote Interface)?

Interview Question: What is lazy loading?

Interview Question: What are the call back methods in Entity bean?

Interview Question: What is abstract schema?

Interview Question: Is it possible to share an HttpSession between a JSP and EJB? What happens when I change a value in the HttpSession from inside an EJB?

Question: What is a Hidden Comment in JSP?

Question: What is the directory structure of a web application?

What is the difference between JTS and JTA?

Can Entity Beans have no create() methods?

Latest Articles (in Interview)

Comment on this tutorial