The Common-Controls Tag Library

<template:insert>

The tag inserts a template blank in the JSP-Page. The template is a JSP-Page that contains placeholder for JSP fragments. The JSP-fragments are addressed by means of a logical name.

The assignment to physical file names is achieved using <template:put>-tags, which are specified within the <template:insert>-tags. For every placeholder in the template, a corresponding <template:put>-tag can be specified.


Body content: JSP
Tag class: InsertTag
Tei class: InsertTei
 

[ Syntax ]

Standard Syntax
<template:insert
template = "String"
[ base = "String" ]
[ id = "" ]
[ locale = "" ]
>
...Body Content...

</template:insert>
 

[ Attributes ]

AttributeTypeDescriptionReq.RTExp
baseString The base directory for the JSP-pages is determined with the base attribute. This also has an action on the included <template:put>-tags.

The base directory can be individually set for every Painter, as the following example shows:

myPainter:/jspCustom;/jspDef

The example uses the base directory /jspCustom for those cases where the Painter myPainter is used. In all other cases, the base directory /jspDef is set.

CAUTION: The pace directory is taken into consideration only in the case of JSP-files that start with$

 
id 
locale 
templateString Specifies the physical filename of the JSP-templates file. The filename is enhanced with the base directory if it starts with $.

[ Example ]

The arrangement of the screen elements of the Tools page is defined by the template MainLayout.jsp.


<%@ taglib uri="http://www.common-controls.com/cc/tags-template" prefix="template" %>

<template:insert id="tm" base="/jsp"  template="$/template/MainLayout.jsp">
    <%--  use resource key translation to localize the title  --%>
    <template:put  name="title"     content="app.resources.company.title" direct="true" locale="true"/>

    <%--  use a string literal  --%>
    <template:put  name="copyright" content="(c) my company" direct="true"/>

    <template:put  name="mainmenu"  content="$/include/ToolsMenu.jsp"/>
    <template:put  name="sidebar"   content="$/include/ToolsSidebar.jsp"/>
    <template:put  name="content"   content="$/include/ToolsRootContent.jsp"/>

    <%--  use a localized "about" page with the help of EL  --%>
    <template:put  name="about"     content="$/include/${pageScope['tm_locale']}/About.jsp"/>
</template:insert>