File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Struts1 tiles Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts1 tiles" Watch "Struts1 tiles" New topic
Author

Struts1 tiles

Chris Pat
Ranch Hand

Joined: Aug 27, 2005
Posts: 156
Hello
I have a properly configured tiles-defs.xml, have the tiles plugin configure in struts-config.xml and when I try a findForward([namedTilesDef]), it says ...not prefaced with /. What is the nomenclature to be able to forward to a tiles definition?
Shailesh Narkhede
Ranch Hand

Joined: Jul 10, 2008
Posts: 368
Hi Chris,

Can you put your code here?


Thanks,
Shailesh
Chris Pat
Ranch Hand

Joined: Aug 27, 2005
Posts: 156
Thanks
Below is the tiles-defs.xml and the template. All that I am doing in my action is a simple mapping.findForward("defaultReport); and it is reporting unable to find forward "defaultReport". If I define a global forward it states defaultReport does not begin with /. How do I "hook" the forward designation into the tiles-defs? A catch-22. Can you help?
tiles-defs.xml
<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 1.3//EN"
"http://struts.apache.org/dtds/tiles-config_1_3.dtd"><tiles-definitions>
<definition name="defaultReport" path="/ccAuth15_template00.jsp" >
<put name="title" value="defaultReport"/>
<put name="report" value="/ccAuth15_PO_all.jsp"/>
<put name="applet" value="/ccAuth13_applet.jsp"/>
</definition>
<definition name="posSO" extends="defaultReport" >
<put name="title" value="defaultReport"/>
<put name="report" value="/ccAuth15_soDetail.jsp"/>
</definition>
<definition name="posPO" extends="defaultReport" >
<put name="title" value="defaultReport"/>
<put name="report" value="/ccAuth15_poDetail.jsp"/>
</definition>
</tiles-definitions>

ccAuth15_template00.jsp
<%@ page errorPage="ccAuth15_template00_error.jsp" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>
<%@ taglib uri="http://struts.apache.org/tags-nested" prefix="nested" %>
<html>
<head>
<title><tiles:getAsString name="title" ignore="true"/></title>
</head>
<body bgcolor="#ffffff">
<tiles:insert attribute="banner"></tiles:insert>
<tiles:insert attribute="report"></tiles:insert>
<tiles:insert attribute="applet"></tiles:insert>

</body>
</html>
Chris Pat
Ranch Hand

Joined: Aug 27, 2005
Posts: 156
Hello
What was needed to stop the error was below. Still a problem in that even though I can, the first time, process and forward to my tiles-defs on the second time I forward and NOTHING happens. No error, no re-processing of the page. The page as an applet in the footer and I am changing the report body depending on the state. How can it be a successful, forward does not change, force the reprocessing of the report body.
<init-param>
<param-name>chainConfig</param-name>
<param-value>org/apache/struts/tiles/chain-config.xml</param-value>
</init-param>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts1 tiles
 
Similar Threads
Tiles 2 - Tomcat Errors etc
Design choice for dispatching request to view
Question with regards to Tiles and facelets
html:link tag
Working with Tiles with Struts Module -