jQuery in Action, 3rd edition
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
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts1 tiles" Watch "Struts1 tiles" New topic

Struts1 tiles

Chris Pat
Ranch Hand

Joined: Aug 27, 2005
Posts: 156
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?

Chris Pat
Ranch Hand

Joined: Aug 27, 2005
Posts: 156
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?
<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 1.3//EN"
<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 name="posSO" extends="defaultReport" >
<put name="title" value="defaultReport"/>
<put name="report" value="/ccAuth15_soDetail.jsp"/>
<definition name="posPO" extends="defaultReport" >
<put name="title" value="defaultReport"/>
<put name="report" value="/ccAuth15_poDetail.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" %>
<title><tiles:getAsString name="title" ignore="true"/></title>
<body bgcolor="#ffffff">
<tiles:insert attribute="banner"></tiles:insert>
<tiles:insert attribute="report"></tiles:insert>
<tiles:insert attribute="applet"></tiles:insert>

Chris Pat
Ranch Hand

Joined: Aug 27, 2005
Posts: 156
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.
I agree. Here's the link: http://aspose.com/file-tools
subject: Struts1 tiles
jQuery in Action, 3rd edition