Struts and Tiles - Steps to use Struts and Tiles
By: Grenfel
- Add TilesRequestProcessor to struts-config.xml
<controller processorClass="org.apache.struts.tiles.TilesRequestProcessor" />
<plug-in className="org.apache.struts.tiles.TilesPlugin" >
<set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" />
<set-property property="moduleAware" value="true"/>
</plug-in>
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
<tiles-definitions>
</tiles-definitions>
d) Add the base definition to the tile definition xml
<definition name="base.definition" path="/Layout.jsp">
<put name="title" value=""/>
<put name="header" value="/common/header.jsp" />
<put name="footer" value="/common/footer.jsp" />
<put name="body" value="" />
</definition>
<definition name="search.page" extends="base.definition">
<put name="title" value="Customer Search and List"/>
<put name="body" value="/CustomerSearchList.jsp" />
</definition>
<definition name="customer.page" extends="base.definition">
<put name="title" value="XYZ Co. Please enter your details"/>
<put name="body" value="/CustomerForm.jsp" />
</definition>
<definition name="dberror.page" extends="base.definition">
<put name="title" value="An error occured"/>
<put name="body" value="/DatabaseError.jsp" />
</definition>
Archived Comments
1. i have been trained in java stream. But i dont know anything in java. a girl is needed to teach me.
View Tutorial By: savio at 2013-01-23 10:15:51
2. can you explain me clearly about struts-config file
View Tutorial By: hanisa at 2012-04-26 06:25:17
3. steps 2 create and use tiles
View Tutorial By: sasank at 2008-10-03 08:06:43
Comment on this tutorial
- Data Science
- Android
- AJAX
- ASP.net
- C
- C++
- C#
- Cocoa
- Cloud Computing
- HTML5
- Java
- Javascript
- JSF
- JSP
- J2ME
- Java Beans
- EJB
- JDBC
- Linux
- Mac OS X
- iPhone
- MySQL
- Office 365
- Perl
- PHP
- Python
- Ruby
- VB.net
- Hibernate
- Struts
- SAP
- Trends
- Tech Reviews
- WebServices
- XML
- Certification
- Interview
categories
Related Tutorials
Configuring JDBC DataSources in Struts
When is the best time to validate input in Struts
Simple example of using the requiredif Validator rule in Struts
How to prepopulate a form in Struts
Using JavaScript to submit a form in Struts
FAQ: Why are my checkboxes not being set from ON to OFF?
FAQ: Why was reload removed from Struts (since 1.1)?
What is a Plug-in and how to use Java plug-ins with Struts?
Origin and Architecture of Struts
Handling multiple buttons in HTML Form in Struts