91-9990449935 0120-4256464 |
MVC in JSPMVC stands for Model View and Controller. It is a design pattern that separates the business logic, presentation logic and data. Controller acts as an interface between View and Model. Controller intercepts all the incoming requests. Model represents the state of the application i.e. data. It can also have business logic. View represents the presentaion i.e. UI(User Interface). Advantage of MVC (Model 2) Architecture
If you new to MVC, please visit Model1 vs Model2 first.Example of following MVC in JSPIn this example, we are using servlet as a controller, jsp as a view component, Java Bean class as a model. In this example, we have created 5 pages:
File: index.jsp
File: ControllerServlet
File: LoginBean.java
File: login-success.jsp
File: login-error.jsp
File: web.xml
Next TopicJstl
|