You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "White, Joshua A (CASD, IT)" <Jo...@thehartford.com> on 2003/03/05 12:29:02 UTC

REPOST - Using tiles mappings in global forwards

If the "forward" attribute of the action element can take both an actual
path or a tiles definition to forward to, shouldn't the global forwards
element have similar functionality?

In Chuck Cavaness's book (Programming Jakarta Struts), he attempts to do
this on page 347.  I just can't get it to work.  Is this perhaps
functionality which is now broken?

Joshua





I have successfully set up tiles using a tiles-def.xml file.  In this file,
I have set up a definition for "my.default".

I have been successfully able to view this layout by inserting the following
code into a jsp:
	<%@ taglib uri="struts-html" prefix="html"%>
	<%@ taglib uri="struts-bean" prefix="bean"%>
	<%@ taglib uri="struts-tiles" prefix="tiles"%>
	<tiles:insert definition="my.default"/>

Again, this works fine.  I have been attempting to declare a global forward
mapping for the same layout:
    <global-forwards>
        <forward name="welcome" path="my.default" redirect="false"/>
    </global-forwards>

I have inserted the following code into a jsp file to test the forwards:
	<%@ taglib uri="struts-logic" prefix="logic"%>
	<logic:forward name="welcome"/>

When I hit the page containing this code, Tomcat gives me a 404 ("The
requested resource (/myapp/my.default) is not available.").  Whats happening
here?  

Joshua


This communication, including attachments, is for the exclusive use of 
addressee and may contain proprietary, confidential or privileged 
information. If you are not the intended recipient, any use, copying, 
disclosure, dissemination or distribution is strictly prohibited. If 
you are not the intended recipient, please notify the sender 
immediately by return email and delete this communication and destroy all copies.


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


Re: REPOST - Using tiles mappings in global forwards

Posted by Simon Kelly <ke...@ipe.fzk.de>.
>     <global-forwards>
>         <forward name="welcome" path="my.default" redirect="false"/>
>     </global-forwards>
>
> I have inserted the following code into a jsp file to test the forwards:
> <%@ taglib uri="struts-logic" prefix="logic"%>
> <logic:forward name="welcome"/>
>

Try changing the path to /WEB-INF/pages/my.default or similar.  It may be
that the mappings pointer to where your my.default resides is not right, so
have a check on those as well.

Cheers

Simon


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