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.
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.
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/>
jsp:setProperty
tag as shown in the signInModule bean
declaration above.
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);
%>
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.*"
%>
<@ include file="/WEB-INF/jsp/WcmHeader.jsp" %> |
Render Headers
<html>
<head>
<% WcmUI.renderHeaders(request, out);
%>
</head>
...
<base href="http://wa-mudblood:7001/Workplace/">
Page names are always base-relative. In your code, you fully qualify a page name by combining the application base path with the base-relative page name, for example:
<base href="http://wa-mudblood:7001/Workplace/properties/WcmMoreObject.jsp?eventTarget=...">
Render UI Modules
...
<body class="wcmBody" bgcolor="white">
<br>
<br>
<br>
<% WcmUi.render(request, "signInModule", out);%>
</body>
</html>
NOTE The above code shows a simple rendering example, where only one UI module is involved. For more complex layouts involving multiple UI modules, page layout modules are used.