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]



Reply via email to