You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by vpsangeetha <vp...@hotmail.com> on 2004/06/04 18:42:31 UTC
Newbie-Q regarding tiles
Hi,
I have a very basic question wrt tiles. I have a tiles-def.xml
defined in the /WEB-INF/ directory with 1 of the definitions being
<definition name="LoginPage" extends="baseDef">
<put name="body" value="/login.jsp"/>
</definition>
I want the first page of my application to use this definition. So in
my web.xml, I define the welcome file and all this file has is
<logic:forward name="login" />
In the struts-config.xml, I have
<global-forwards>
<forward name="login" path="LoginPage" />
</global-forwards>
But I get the error
HTTP ERROR: 404 /alarmagent/LoginPage Not Found
Any idea why this is happening? And does anyone know a way around it?
Thanks & sorry if the q is very trivial.
Sangeetha.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Newbie-Q regarding tiles
Posted by Christian Bollmeyer <ja...@christianbollmeyer.de>.
On Friday 04 June 2004 18:42, vpsangeetha wrote:
You can't directly access Tiles definitions from
your JSPs, but have to wrap them into Struts
actions (in struts-config.xml) like this:
<action path="/login" forward="loginPage"/>
Then call login.do, and it will work.
HTH,
-- Chris.
> Hi,
>
> I have a very basic question wrt tiles. I have a tiles-def.xml
> defined in the /WEB-INF/ directory with 1 of the definitions being
>
> <definition name="LoginPage" extends="baseDef">
> <put name="body" value="/login.jsp"/>
> </definition>
>
> I want the first page of my application to use this definition. So in
> my web.xml, I define the welcome file and all this file has is
>
> <logic:forward name="login" />
>
> In the struts-config.xml, I have
>
> <global-forwards>
> <forward name="login" path="LoginPage" />
> </global-forwards>
>
> But I get the error
> HTTP ERROR: 404 /alarmagent/LoginPage Not Found
>
> Any idea why this is happening? And does anyone know a way around it?
>
> Thanks & sorry if the q is very trivial.
> Sangeetha.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: Newbie-Q regarding tiles
Posted by David Friedman <hu...@ix.netcom.com>.
Sangeetha,
Your error suggests a redirect is
occurring, not a forward. A tile
cannot be seen from the web, only
from inside the struts framework,
hence that error messager.
I recommend you replace the contents
of your welcome file with code to
pull in and insert the tile, which
goes something like this, but don't
quote me on it.
(I'd posted about this in the archives months ago):
<%@ taglib uri="/tags/struts-tiles" prefix="tiles" %>
<tiles:insert definition="LoginPage"/>
Regards,
David
-----Original Message-----
From: vpsangeetha [mailto:vpsangeetha@hotmail.com]
Sent: Friday, June 04, 2004 12:43 PM
To: struts-user@jakarta.apache.org
Subject: Newbie-Q regarding tiles
Hi,
I have a very basic question wrt tiles. I have a tiles-def.xml
defined in the /WEB-INF/ directory with 1 of the definitions being
<definition name="LoginPage" extends="baseDef">
<put name="body" value="/login.jsp"/>
</definition>
I want the first page of my application to use this definition. So in
my web.xml, I define the welcome file and all this file has is
<logic:forward name="login" />
In the struts-config.xml, I have
<global-forwards>
<forward name="login" path="LoginPage" />
</global-forwards>
But I get the error
HTTP ERROR: 404 /alarmagent/LoginPage Not Found
Any idea why this is happening? And does anyone know a way around it?
Thanks & sorry if the q is very trivial.
Sangeetha.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org