Framework Page

As shown in the following diagram, the abstraction of a controller framework page consists of two physical Java™Server Pages (JSP) pages. These are called the event JSP and the UI JSP.

controller framework page

When a request is made for a JSP page, the event JSP page loads. In the event JSP, the UI modules, the data providers, and the controller are declared. The modules are registered to the controller. This process creates the "model" component of the MVC methodology and executes it. The event JSP then redirects control to the UI JSP page.

The UI JSP represents the display of the page. It contains the HTML for the page, and calls to render the UI modules. This represents the "view" component of the MVC methodology. The UI JSP does not directly call the render method of the UI module(s). It instead calls the WcmUi helper class, which is used to render UI modules and page headers (via WcmHeaderModule, as described in HTML Headers -- Using Default Implementation).

Event JSP pages are stored relative to the application root. UI JSP pages are stored relative to the uiRoot context parameter in <app_root>/WEB-INF/web.xml. The default value is "UI-INF", and the string "jsp/ui" is implicitly added by WcmController, yielding "UI-INF/jsp/ui". The following example shows the location of an event JSP and its corresponding UI JSP.

This example assumes a one-to-one mapping of separate event and UI JSP pages. This is not a hard requirement. For example, the framework allows for many event JSPs to map to a single UI JSP -- assuming that UI modules are given the same names on each event JSP. In addition, you can consolidate the event and UI parts into a single JSP page.

Event JSP

An event JSP page consists of the sections listed below. For details on a particular JSP section, click the applicable link.

Declare Page Directive
<%@ page errorPage="/WcmError.jsp" autoFlush="false" %>
Declare Module Beans and Controller
<jsp:useBean
  id="signInModule"
  class="com.filenet.wcm.apps.server.ui.WcmSignInModule"
  scope="request"/>
  <jsp:setProperty name="signInModule" property="name" value="signInModule"/>
<jsp:useBean/>

<jsp:useBean
  id="controller"
  class="com.filenet.wcm.apps.server.controller.WcmWorkplaceController"
  scope="request"/>
<jsp:useBean/>
Register and Execute
<%
  com.filenet.wcm.toolkit.util.WcmString heading =
    new WcmString("server.WcmSignIn_jsp.heading", "Sign In");

  controller.configurePage(application, request);
  controller.getHeaderModule().setTitle(heading.toString);
  controller.registerModule(signInModule);
  controller.handleEvent(application, request, response, true);
%>

UI JSP Page

A UI JSP page consists of the sections listed below. For details on a particular JSP section, click the applicable link.

Declare Page Directive
<%@ page errorPage="/WcmError.jsp" autoFlush="true"
  contentType="text/html; charset=UTF-8"
  import="com.filenet.wcm.toolkit.server.util.*"
%>
Render Headers
<html>
  <head>
    <% WcmUI.renderHeaders(request, out);
    %>
  </head>
  ...
Render UI Modules
...
  <body class="wcmBody" bgcolor="white">
    <br>
    <br>
    <br>
    <% WcmUi.render(request, "signInModule", out);%>
  </body>
</html>