What is the role played by JSP in the MVC architecture
-
Model
-
View
-
Controller
-
None of the above
In MVC architecture, JSP pages serve as the View layer responsible for presentation and display. The Model represents data and business logic (Java beans, EJBs). The Controller manages flow and request handling (Servlets, Struts actions). JSP templates display data provided by the controller.
In the Java MVC pattern, JSP plays the role of the View: it receives data prepared by the Controller (typically a servlet) and renders it as the presentation layer (HTML) shown to the user. The Model holds business logic and data (plain Java classes, EJB, Hibernate entities, etc.), and the Controller manages request flow — JSP does neither of those, so the correct answer is View, not Model.