The events generated by the front component are forwarded to a template presentation component. 4.3.1.2 Presentation Components Many Web applications have a shopping cart that contains the products that a user has selected for purchase. In most applications the content of the shopping cart needs to be displayed repeatedly. The code that generates the shopping cart display should be maintainable by content providers. Since the shopping cart JavaBeans object and JSP page that generates the HTML representation of the shopping cart can also be used in more than one part of an application, the presentation components used to generate the HTML representation of the shopping cart should also be modular and reusable.
Modular design allows separation of roles.
Content providers can specialize in how content is displayed, and component developers can focus on the logic that is used in the JavaBeans component to manipulate the shopping cart data, and on the JSP page that generates the HTML representation of the data. Note that the data that is presented to the user may be taken from multiple sources. Other requirements that presentation components must address are creating a consistent look and feel for an application while providing mechanisms for personalizing the user interface. For example, consider a Web site that has a personalized banner, a navigation menu that displays only information that a user wants to see, and the content a user wants to see. The next section describes how to design a JSP page or set of JSP pages that allow for a consistent look and feel throughout an application.