Ya sorry that is a hard question.. here let me give more explanation:
<definition name=".Default" path="/tiles/layouts/base.jsp">

<put name="header" value="/tiles/header.jsp"/>

<put name="menu" value="${menu}"/>

<put name="body" value="${body}"/>

<put name="footer" value="/tiles/footer.jsp"/>

<put name="logon" value="/tiles/logon.jsp"/>

<put name="title" value="Sales Web"/>

<put name="messages" value="/tiles/messages.jsp"/>

</definition>

<definition name=".Forum" extends=".Default">

<put name="body" value="/forum/index.jsp"/>

<put name="menu" value=".menu.Forum"/>

</definition>



These are my two tile definitions in my tiles-defs.xml file.  I call a jsp
file, for example test.jsp it contains:

<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>



<tiles:insert definition=".Forum" flush="true">

<tiles:put name="body" value="/forum/test-.jsp"/>

</tiles:insert>

(which is basically just a way to call a definition without using a struts
action for right now)

The above fills everything into our page layout and overrides body with
test-.jsp.  Now test-.jsp goes into the body slot, the main area on the
page.  I do some logic in it and determine, before its rendered, that the
user is not logged in or whatever else, and instead of it going into the
body area it needs to redirect to another page to fill that slot.  However
when I try that the body area just comes up blank.  And thats just using:

url = response.encodeRedirectURL(request.getContextPath() +
"/forum/transition.jsp");

response.sendRedirect(url);

return;

I know the above redirect code works, because when I put it in a .jsp that
does not includes our tiles layout it works fine.

Help!

-David

----- Original Message ----- 

From: "Adam Hardy" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, October 29, 2003 3:43 PM
Subject: Re: Tiles Redirect Bug on a per Tile basis? Help!


> On 10/29/2003 11:04 PM David Erickson wrote:
> > Bug description:
> > Using tiles to handle our webpage.  I have an individual tile which is a
jsp
> > that does some logic on our forums, if a certain situation occurs that
tile
> > when loaded will attempt to redirect to a error page.  However this does
not
> > work.  Instead where that tile should be it just comes up blank.  I have
> > also tried getting the request dispatcher and forwarding if that error
> > occurs but it says that the response has been commited and throws an
> > exception..  so how in the world am I supposed to insert a different
page
> > there if this condition comes up!
>
> That is a demanding question. The problem is that the outer-most Tile
> controls its child Tiles. This is a complete stab in the dark but try
> writing the redirect URL into the request attributes, and then at the
> end of the outermost Tile, check to see if there is a non-null value,
> and if so, do the redirect there.
>
> Adam
>
>
> -- 
> struts 1.1 + tomcat 5.0.12 + java 1.4.2
> Linux 2.4.20 RH9
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to