Use tiles templates in SpringSide2.0 to reduce duplication of web page code

Source: Internet
Author: User

In web development, the duplication of web code is an unavoidable problem. We do the site, all the pages will have a more unified page layout, only with the data-related parts will be different. If each page contains complete HTML code, it will cause a lot of duplicate code, and in the modification of those public parts (such as the page header and the end of the page), it is very troublesome to modify multiple pages.

Of course, there are many ways to solve this problem, in the ASP.net, there is a mechanism called the motherboard can do, in Java development, there are many ways, the simplest is to use in the JSP file with the include directive, you can also use a lot of other Third-party template library.

I am using the tiles template engine, tiles is a component of struts, so when used in SpringSide2.0, do not need to download third-party components, and do not need additional configuration, directly use the line.

For example, in my website, my welcome.jsp layout diagram is as follows:

The layout of my user registration page reguserstep1.jsp is as follows:

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.