[Studies] Tiles

명원식·2023년 8월 22일
0

Studies

목록 보기
9/9
post-thumbnail

An open-source library that provides layout functionality for web pages.

Features of Tiles:
1. Enables easy and straightforward implementation of page layouts.
2. Facilitates easy maintenance due to the use of shared layouts.

Pom.xml Tiles Dependencies

<dependency>
    <groupId>org.apache.tiles</groupId>
    <artifactId>tiles-core</artifactId>
    <version>2.2.2</version>
</dependency>
<dependency>
    <groupId>org.apache.tiles</groupId>
    <artifactId>tiles-jsp</artifactId> 
    <version>2.2.2</version>
</dependency>
<dependency>
    <groupId>org.apache.tiles</groupId>
    <artifactId>tiles-servlet</artifactId> 
    <version>2.2.2</version>
</dependency>

Generally, in web applications, it's not necessary to implement every screen feature individually. Instead, a common approach is to create a consistent overall layout and only change the content section when needed.

For instance, in a product detail page, the top part of the screen remains constant while only the content in the body section changes.

The typical structure of a web application screen involves creating separate pages to handle the top section, left menu, and bottom section. When a web page is requested in the browser, the main content is added to this layout, and only the content body is displayed.

To provide this kind of screen layout functionality, the concept of "tiles" is introduced. Tiles is a framework for creating JSP page layouts easily. While Spring and Struts also offer this functionality, Tiles can also be used independently.

When using Tiles, the following advantages can be observed:

  • Implementation of page layouts becomes easier and simpler.
  • Maintenance is streamlined due to the use of common layouts.

Tiles functionality can be easily added to a project by including the corresponding library through the pom.xml file.

  1. Specify the view name for the common layout.
  2. Define the location of the JSP that establishes the overall layout.
  3. Specify the location of the JSP that constructs the top section (header) within the layout.
  4. Define the location of the JSP that constructs the side menu within the layout.
  5. Specify the location of the JSP that constructs the bottom section within the layout.
  6. Specify the view name for the main screen.
  7. The basic layout inherits from baseLayout.
  8. Specify the content to display in the layout's title.
  9. Specify the JSP to display in the layout's main content.
profile
but i brought potato salad

0개의 댓글