Use rapid-framework to inherit jsp page instances,
For multiple webpage pages, many parts are the same and should inherit the same page, which is the parent page of all pages.
Then I searched for a rapid-framework. Since maven is used, the introduction is very simple.
<dependency> <groupId>com.googlecode.rapid-framework</groupId> <artifactId>rapid-core</artifactId> <version>4.0.5</version></dependency>
Parent page
... <% @ Taglib prefix = "rapid" uri = "https://www.rapid-framework.org.cn/rapid" %>... <body> <! -- Body --> <rapid: block name = "content"> 123 </rapid: block ></body>
<Rapid: block name = "content"> defines a part of content, which can be rewritten on a subpage.
Subpage
<% @ Page contentType = "text/html; charset = UTF-8 "language =" java "%> <% @ taglib prefix =" rapid "uri =" https://www.rapid-framework.org.cn/rapid "%> <rapid: override name = "content"> This is the content </rapid: override> <% @ include file = "base. jsp "%>
<% @ Include file = "base. jsp" %> introduce the parent page to overwrite the content part of the parent page. When accessing a child page, the elements in the parent page are not displayed, instead of the content overwritten by the Child page.