Blue Elephant Referee Scheduler
Page Composition
Intro:
In large web sites, some common functionality, such as navigation menus, must be present on every page. Page Composition refers to the separation of such common functionality into individual fragments, one per file. Pages then include these fragments when they wish to use common functionality. Page Composition can be used to include common configuration elements, and to provide a uniform style to the entire site.
Motivation:
When some common functionality needs to be changed, it can be changed in a central location, the fragment, instead of on every page that uses it. This allows for a much cleaner and flexible design.
Usage:
As can be seen above, all parts of the page that do not strictly deal with the content specific to the page are factored out into individual JSP fragments. For a page that a user sees when logged in, three JSP include directives are needed:
<@ include file=”fragments/Meta.jsp”> inside the <head> tag,
<@ include file=”fragments/Header.jsp”> as the first element of the <body>, and
<@ include file=”fragments/Footer.jsp”> as the last element of the <body>.
The sub-components can also be included individually.
Of particular interest is Messages.jsp, which should be included to display any info or error messages returned by a Struts Action.