Adam, Essentially I just want to display a different content in that area of my layout. And I considered using a jsp:include, but by the point the logic determines that a different page needs to be in that spot it has already loaded a bunch of JSP variables and stuff into the page, by including another page with variables potentially the same would it mess everything up? Also for example was:
if (x condition is met) { %> <jsp:include "blah.jsp> <% return; } %> Would that return successfully quit running any logic from my original jsp? Thanks, David ----- Original Message ----- From: "Adam Hardy" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Thursday, October 30, 2003 1:14 AM Subject: Re: Tiles Redirect Bug on a per Tile basis? Help! > On 10/29/2003 11:52 PM David Erickson wrote: > > 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. > > It's not clear whether you want to do a redirect to take the user to a > different page, which is what I assumed from your first message, or > whether you want to stay on that page and just have different content in > your body slot. > > If you only need different content, why do a redirect? Why can't you > just do a straight jsp:include? > > 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]