struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Lucia" <timlu...@yahoo.com>
Subject RE: Tiles setup question
Date Tue, 09 Dec 2003 01:42:04 GMT
The global forwards work for struts taglib tags, generally as the value
of the name="" attribute.  They do not export to the web server (servlet
mapping, *.jsp, etc.) level.  Thus, to access the forward you defined:

   <global-forwards>
       <forward name="index" path="/myapp.index"/>
   </global-forwards>

You would say:

<html:link forward="index">[Return to main menu]</html:link>

However, the target of path cannot be a tile, it must be an action which
forwards to the tile. [Is this true?  I have never seen a tile as a
global forward target]

Here is an example:

Your.jsp:
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<html:link forward="tileTest">[return to main menu]</html:link>

Your-struts-config.xml:
		<forward name="tileTest" path="/tileTest.do"/>
		
		<action path="/tileTest"
		        type="org.apache.struts.actions.ForwardAction"
		        parameter=".tileTest"/>

Your-tiles-def.xml:
  <definition name=".tileTest" extends="layout"/>


Tim Lucia

> -----Original Message-----
> From: Richard Hill [mailto:RHill@classmates.com] 
> Sent: Monday, December 08, 2003 7:59 PM
> To: 'struts-user@jakarta.apache.org'
> Subject: Tiles setup question
> 
> 
> I'm setting up tiles with an example application and I'm 
> getting blocked when trying to use Tiles layout names instead 
> of the JSP filenames in the struts-config.xml. I'm hoping 
> that someone on this list can point out what I'm doing wrong.
> 
> I can access the application by explicitly typing in 
> "index.jsp" in the url, but when I try a page with a link 
> defined in my struts-config.xml global-forwards name="index" 
> I get an error message: The requested resource
> (/myapp/myapp.index) is not available.
> 
> My tomcat localhost.log file show that the Tiles definition 
> factory gets loaded...what am I missing?
> 
> Thanks,
> Richard
>



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message