O'Reilly logo

Special Edition Using Java™ 2 Enterprise Edition by Mark Wutka

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using MVC in a Web Application

Most developers think of MVC in terms of a graphical user interface because MVC really came from GUI development. With a little imagination, however, you can extend the MVC paradigm to Web development, in terms of servlets and JSP. The idea is that you split your application into three sections. A servlet handles any requests from the browser and acts as a controller. You put your business logic (the model) in Java classes that are neither servlets nor Java Server Pages. Finally, you use Java Server Pages to display the view, a representation of the model.

When applying MVC to a Web application, you have to make some concessions toward the way the Web works. When you use MVC in a GUI application, you can display ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required