You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by jo...@gim.be on 2003/03/12 09:13:29 UTC

Trying to link a forward-tag with a tile definition.

Hello,

I would like to use the forward-tag in the logic tag-library to forward to
a tile definition:

JSP-file:

     <logic:forward name="myGlobalForward"/>

Struts configuration file:

     <global-forwards>
          <forward
               name="myGlobalForward"
               path=".my.tile.Definition"/>
     </global-forwards>

Unfortunately, this does not seem to work! Tomcat returns an error that it
cannot find the file "/context/.my.tile.Definition", thus, the definition
name is interpreted as a URL path in stead of being mapped to the tile
definition.

Passing an action explicitely does work however (I'm using Scaffold
relay-action in this example):

JSP-file:

     <logic:forward name="myGlobalForward"/>

Struts configuration file:

     <form-beans>
          <form-bean
               name="relayForm"
               type="org.apache.struts.action.DynaActionForm">
               <form-property
                    name="dispatch"
                    type="java.lang.String"/>
          </form-bean>
     </form-beans>

     <global-forwards>
          <!---------------------------------------------->
          <!-- myGlobalForward: forward to relay action -->
          <!---------------------------------------------->
          <forward
               name="myGlobalForward"
               path="/relay.do?dispatch=mySecondGlobalForward"/>
          <!------------------------------------------------------->
          <!-- mySecondGlobalForward: forward to tile definition -->
          <!------------------------------------------------------->
          <forward
               name="mySecondGlobalForward"
               path=".my.tile.Definition"/>
     </global-forwards>

     <action-mappings>
          <action
               path="/relay"
               type="org.apache.struts.scaffold.RelayAction"
               name="relayForm"
               validate="false">
          </action>
     </action-mappings>

MY QUESTIONS:

1. Why do I have to pass an action explicitely for the tile definition
names to be mapped?
2. I do not like the workaround. Is there another way to forward directly
to a tile definition?


Thank you in advance,

Joeri




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