Tiles Overview

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Tiles Overview as PDF for free.

More details

  • Words: 379
  • Pages: 11
Page1.jsp

Page2.jsp

Page3.jsp

Header

Header

Header

Body-1

Body-2

Body-3

Footer

Footer

Footer

.

Limitations: Duplication of code, the same Header and Footer is included in all three pages. Solution: Separate, Header and Footer from each page. Use < jsp:include > tag for inserting Header.jsp and Footer.jsp.

Header.jsp

Footer.jsp

Page1.jsp

Page2.jsp
<jsp:include page=”/Header.jsp>
<jsp:include page=”/Footer.jsp>


Page3.jsp
<jsp:include page=”/Header.jsp>
<jsp:include page=”/Footer.jsp>


Limitations: The same table structure (ie layout) is repeated in all the three pages. Solution : Separate layout from each page, and provide placeholders Include the layout in the required page using < tiles:insert page=”/Layout.jsp”> Populate the pages required using

Layout.jsp
<jsp:include page=”/Header.jsp>
<jsp:include page=”/Footer.jsp>


Header.jsp

Footer.jsp

Page1.jsp

Page2.jsp

Page3.jsp

















Limitations: Suppose the layout is changed to below given then we need to make changes in Layout.jsp, and in all the jsp pages which make use of Layout.jsp Header

Menu Body

Footer

Solution: Using tiles-defs.xml define all the jsp pages Using populate the jsp pages

Layout.jsp


Header.jsp

Footer.jsp

<definition name=”def1” path=”/Layout.jsp”> <definition name=”def2” path=”/Layout.jsp”>

Body1.jsp

Body2.jsp

Menu.jsp

Page1.jsp

Page2.jsp





Limitation: In tiles-defs.xml the definition tab has repeated tags

Solution: Use <definition extends=> to extend the properties of base definition <definition name=”basedef” path=”/Layout.jsp”> <definition name=”def1” extends=”basedef”> <definition name=”def2” extends=”basedef”>

Related Documents

Tiles Overview
November 2019 18
Tiles
October 2019 24
Text Tiles
May 2020 27
Lovric Tiles
June 2020 16
Spec Tiles
June 2020 12
Advanced Tiles
November 2019 29