Content layout in a JSP

Source: Internet
Author: User

Reference: Https://

In the development of the front-end Web page, the site generally has a template page, to save the entire site The most basic style, and other pages are in this style to modify. This function can be implemented by tag in JSP.

Create a new Base.tag template page in the web-inf/tags/directory to save the newly created template:

<% @tag description= "Overall page template" pageencoding= "UTF-8"%>  <%@ taglib  prefix= "C"  uri= " Http:// "%>  <% @attribute name=" num "rtexprvalue=" false "required=" true "%>  <% @attribute name= "header" fragment= "true" required= "true"%>  <% @attribute name= "Footer" fragment= "True" required= "true"%>      

In this template we define two replaceable parts: header,footer, a variable num.

The Sub-page uses this label as follows:

    <% @taglib prefix= "T" tagdir= "/web-inf/tags"%>            <t:base num= "abc" >            <jsp:attribute name= " Header ">      <title>Welcome</title>      

Content layout in a JSP

Related Article

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: 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.