One of the main components in my project is a file called tiles.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN"
"http://tiles.apache.org/dtds/tiles-config_3_0.dtd">
<tiles-definitions>
<definition name="base.definition" template="/WEB-INF/layoutStyle/layout.jsp">
<put-attribute name="title" value="" />
<put-attribute name="header" value="/WEB-INF/layoutStyle/header.jsp" />
<put-attribute name="body" value="" />
<put-attribute name="footer" value="/WEB-INF/layoutStyle/footer.jsp" />
</definition>
<definition name="home" extends="base.definition">
<put-attribute name="title" value="home" />
<put-attribute name="body" value="/WEB-INF/jsp/home.jsp" />
</definition>
</tiles-definitions>
The configuration in the spring-servlet.xml file includes the following:
<?xml version="1.0" encoding="utf-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:lang="http://www.springframework.org/schema/lang"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:p="http://www.springframework.org/schema/p"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="...">
<!-- Various bean configurations and URL mappings -->
</beans>
The web.xml file contains servlet configurations, such as:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="..."
xmlns="..."
xmlns:web="..."
xsi:schemaLocation="..."
version="3.0">
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
In the layout.jsp file, the structure of the webpage is defined with various tile attributes for header, body, and footer.
The other JSP files like header.jsp, footer.jsp, home.jsp, and index.jsp provide specific content and styling for different parts of the web application.
However, there seems to be an issue where only the body content is displayed when running the project, without the header and footer elements. It's important to review the configurations and ensure that the tiles are correctly set up to include all necessary components for each page.