Use Composite Views that are composed of multiple atomic subviews. Each subview of the overall template can be included dynamically in the whole, and the layout of the page can be managed independently of the content.
Apache Tiles and SiteMesh frameworks use Composite Views pattern.
This pattern is divided into a number of sections for simplicity like problem, forces, structure, solution, source code etc.
This pattern is divided into a number of sections for simplicity like problem, forces, structure, solution, source code etc.
Table of Contents
ProblemForces
Solution
Explanation
Structure - Class Diagram, Sequence Diagram
Participants and Responsibilities
Implementation
Consequences
Applicability
Real world examples
References
Read above topics on http://www.javaguides.net/2018/08/composite-view-design-pattern-in-java.html