[ Team LiB ] Previous Section Next Section

Summary

Although servlets and JSPs are flexible enough to perform most tasks in a Web application, you'll want to follow some basic guidelines.

Servlets are frequently used to do work that does not directly interact with the end user but rather interacts with server-side components to generate content or perform tasks. On the other hand, JavaServer Pages are most often concerned with presentation. Well-designed JavaServer Pages use programmatic elements to present a response in a useful way to a client.

Architectural patterns such as Model 1 and Model 2 can help you design your application so that it best meets your current and future needs. Model-View-Controller is often used to structure applications so that the application's components have well-defined roles and are able to interact flexibly with their peers. Using MVC, business objects represent the model, servlets act as controllers, and JavaServer Pages provide the views.

    [ Team LiB ] Previous Section Next Section