Insert tag<Template: Insert> the tag can insert a dynamic Template into the JSP page of the application. This tag has only one template attribute to define the template JSP page. The page to be inserted to the template is specified by multiple <template: Put> tags, which are defined as the subject content of the <template: Insert> tag.
Placement tag<Template: Put> the tag is used internally by the <template: Insert> tag to specify the resource to be inserted to the template. The attributes are as follows:
Attribute |
Description |
Content |
Defines the content to be inserted, such as a JSP file or an HTML file. |
Direct |
If this parameter is set to true, the content specified by the content attribute is directly displayed on the JSP instead of as a file containing the content. |
Name |
Name of the content to be inserted |
Role |
If this attribute is set, content can be inserted only when the current legal user has a specific role. |
MarkOn the template JSP page, use the <template: Get> tag to retrieve the resources inserted to the JSP page by the <template: Put> tag. The attributes are as follows:
Attribute |
Description |
Name |
The name of the inserted content is marked by <template: Put>. |
Role |
If this attribute is set, Content Retrieval can be performed only when the current legal user has a specific role. |
Use template tagFirst, compile a template JSP page, which will be used by all web pages: The JSP page of this application uses the <template: insert tag to define the template, and then uses the <template: Put> tag to place the resource specified by the specific content name to the template JSP page. If we have hundreds of pages with the same layout but suddenly want to change this template, we only need to change the template. jsp file.