Struts template tag

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.