Document

Description: A document encloses the HTML page to be generated. It generates the HTML document tag, the head section and the body open/close.

Remarks: This tag also receives all JavaScript and CSS contribution of all inner components and inner pages and it's components.
These are then generated in the proper places and in the proper order. More on this here.

The DocType is strictly defined. This is so that the XHTML/HTML rules are always obeyed. You can select one of the DocTypes for HTML 4.01 and XHTML 1.0.
See available docTypes here

The templateID will force this page to be rendered inside the specified stage.
This template stage must have a pageContent tag where the main stage content will be inserted inside the template body.
Only the main stage will call the template rendering process. A inner stages called as components will ignore the templateID parameter if set.

JavaDoc: Click here

Body content: JSP content.

Attributes:

Name Description Data type Required Default value
title The page title String No The title message in the page's message file, or, if non-existent, the stage name
docType The DocType. See available docTypes here String No XHTML 1.0 Transitional
charset The charset String No ISO-8859-1
templateID The stage id that will be used as a template. Only the main stage will use this if set. String No -
templatePopupID The stage id that will be used as a template for popups. Only the main stage will use this if set. String No -
addDefaultCSSContributions If true will add default CSS styles to the page, as defined in the presentation configuration. Boolean No False
maskOnLoad If true will apply a page mask during javascript load execution. Boolean No False

Variables: This tag defines in it's context the following variables:

Name Description Data type
messages The translated page messages Map
difrequest The DIF request object IDIFRequest
difresponse The DIF response object IDIFResponse
difsession The current DIF session IDIFSession
stage The current stage instance. Will have all interface defined methods plus your POJO defined ones IStageInstance
contentStage The content stage instance when in template mode. Will have all interface defined methods plus your POJO defined ones IStageInstance

All these variables are accessible in the JSP through JSP 2.0 Expression Language.
A tutorial on how to use this language can be found in SUN's site here.

Some examples can be seen bellow.

Examples:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/difcore" prefix="dif"%>
<dif:document>
    <p>
        <b>A message called "someMessage":</b> ${messages.someMessage} <br />
        <b>The name of the client (browser) from the request:</b> ${difrequest.client.name} <br />
        <b>The JSP filename of the view in use for the response generation:</b> ${difresponse.view.target} <br />
        <b>A property in session called "some.prop":</b> ${difsession.attributes["some.prop"]} <br />
        <b>A stage method added by the codegeneration process to our stage POJO that returns it's name:</b> ${stage.name]} <br />
    </p>
</dif:document>

Back to tag reference