ServiceLink Component Index Submit

Shell
org.apache.tapestry.html.Shell
Non Visual Component
 
Description
Provides the outer 'shell' of a page, including the <html>, <head> and <title> tags, but not the <body> tag which is typically provided by a Body component.

Most Tapestry pages will include a Shell component followed by a Body component. The Shell is used to resolve the page's HTML stylesheet and the Body component manages dynamically generated JavaScript.

When designing the look and feel of a Tapestry page, include the normal HTML elements before the Shell component, including a <link rel="stylesheet"> element, so that the page will render normally in a web browser, but use a <span jwcid="$content$"> around the actual content.

See Also
Body, Script
Parameters
Name Type Direction Required Default Description
title String in yes   Used to provide the window title for the page.
stylesheet IAsset in no   Creates a <link rel="stylesheet"> element.
stylesheets Array or collection of IAsset in no   Creates a series of <link rel="stylesheet"> element, one for each asset.
refresh int in no   If provided (and non-zero), then a <meta http-equiv="Refresh"> element is included in the header. The refresh interval is the value provided (which is the time to display the page, in seconds).

The refresh will be the same page (not necessarily the same URL as that which initially presented the page, since the page will often be initially displayed because of a link or form submission).

Note that to the tag, a refresh of zero means refresh immediately. For this component, a refresh of zero is the same as unspecified: no automatic refresh.

doctype String in no HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd" Used to specify the full definition of the DOCTYPE element in the response page. For example, setting this parameter to
math SYSTEM "http://www.w3.org/Math/DTD/mathml1/mathml.dtd"
will make the component generate
<!DOCTYPE math SYSTEM "http://www.w3.org/Math/DTD/mathml1/mathml.dtd">

The list of currently valid DOCTYPE settings can be found here: http://www.w3.org/QA/2002/04/valid-dtd-list.html

If the parameter is null or empty, no DOCTYPE tag will be rendered

DTD String in no null Used to specify the DOCTYPE DTD of the generated HTML document.

This parameter is deprecated. Please use the doctype parameter instead.

delegate IRender in no   If specified, the delegate is invoked just before the </head> tag. This allows the delegate to write additional tags, often meta tags of various types.
renderContentType boolean in no true Determines whether the component will render an http-equiv element with the Content Type of this response. It is necessary to render this element to ensure that the browser will encode the POST parameters using the encoding defined in the Content Type. Otherwise the browsers may use the default encoding of the client machine, which cannot be known by the server. If you set this parameter to false, please make sure that you can decode the HTTP request parameters correctly.

Body: rendered
Informal parameters: allowed (applied to <html> tag)
Reserved parameters: none

Examples

The Shell component is used here to provide the page's stylesheet and title.

Note in this example a common stylesheet file style.css is located in the class path directory /com/mycorp/pages/ while the page's class is in /com/mycorp/pages/customer/login/. The HTML header uses a relative path to resolve the stylesheet.

Customer Login

Welcome to MyCorp's Customer Portal secure login page.

Please call 1800 230 187 for TR-2 recall information.

<html>
<head>
 <link rel="stylesheet" type="text/css" href="../../style.css" title="style">
 <title>MyCorp Customer Login</title>
</head>

<span jwcid="$content$">
<span jwcid="@Shell" stylesheet="ognl:assets.stylesheet" title="MyCorp Customer Login">
<body jwcid="@Body">

<h1>Customer Login</h1>
Welcome to MyCorp's Customer Portal secure login page.
<p>
<span jwcid="@Insert" value="ognl:dailyMessage" class="ognl:messageClass"/>

</body>
</span>
</span>
</html>


<property-specification name="dailyMessage" type="java.lang.String"/>
<property-specification name="messageClass" type="java.lang.String"/>
<private-asset name="stylesheet" resource-path="/com/mycorp/pages/style.css"/>


package com.mycorp.pages.customer.login;

public abstract class CustomerLoginPage extends BasePage {
    public abstract String getDailyMessage();

    public abstract String getMessageClass();
    
}

ServiceLink Component Index Submit