You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Scott Johnson <sc...@yahoo.com> on 2004/04/03 00:48:54 UTC
Tiles String Buffer BUG!
If you have an empty tiles:put tag in a jsp:
<tiles:put name="myTile"></tiles:put>
and you call it from a layout jsp:
<tiles:getAsString name="myTile"/>
You will end up with the last tile displayed from ANY application
using tiles in your VM. In our case, we have different customers on
different instances of the same application. Imagine seeing the body
content from somebody else's instance in yours!
A two-page sample of this bug is as follows:
---page 1, the layout page named testLayout.jsp----
<%@ taglib uri="/layouts/struts-tiles.tld" prefix="tiles" %>
<HTML>
<HEAD>
<TITLE>BUG</TITLE>
</HEAD>
<BODY>
Section 1----------<BR>
<tiles:getAsString name="section1"/>
<BR>================<BR>
Section 2----------<BR>
<tiles:getAsString name="section2"/>
</BODY>
</HTML>
-----page 2, the display page
<%@ taglib uri="/layouts/struts-tiles.tld" prefix="tiles" %>
<tiles:insert page="testLayout.jsp" flush="true">
<tiles:put name="section1"></tiles:put>
<tiles:put name="section2">
This is section 2. The current system time is <%=
System.currentTimeMillis() %>
</tiles:put>
</tiles:insert>
View the display page, then hit reload. After you hit reload, you will
see something like this:
Section 1----------
This is section 2. The current system time is 1080945966646
================
Section 2----------
This is section 2. The current system time is 1080945967221
Kaboom!
Scott Johnson
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Tiles String Buffer BUG!
Posted by James Mitchell <jm...@apache.org>.
On Fri, 2 Apr 2004, Scott Johnson wrote:
This seems more appropriate for the dev list, no?
> If you have an empty tiles:put tag in a jsp:
> <tiles:put name="myTile"></tiles:put>
>
> and you call it from a layout jsp:
> <tiles:getAsString name="myTile"/>
>
> You will end up with the last tile displayed from ANY application
> using tiles in your VM. In our case, we have different customers on
> different instances of the same application. Imagine seeing the body
> content from somebody else's instance in yours!
>
> A two-page sample of this bug is as follows:
> ---page 1, the layout page named testLayout.jsp----
> <%@ taglib uri="/layouts/struts-tiles.tld" prefix="tiles" %>
> <HTML>
> <HEAD>
> <TITLE>BUG</TITLE>
> </HEAD>
> <BODY>
> Section 1----------<BR>
> <tiles:getAsString name="section1"/>
>
> <BR>================<BR>
>
> Section 2----------<BR>
> <tiles:getAsString name="section2"/>
> </BODY>
> </HTML>
>
>
> -----page 2, the display page
> <%@ taglib uri="/layouts/struts-tiles.tld" prefix="tiles" %>
> <tiles:insert page="testLayout.jsp" flush="true">
> <tiles:put name="section1"></tiles:put>
> <tiles:put name="section2">
> This is section 2. The current system time is <%=
> System.currentTimeMillis() %>
> </tiles:put>
> </tiles:insert>
>
>
>
> View the display page, then hit reload. After you hit reload, you will
> see something like this:
>
> Section 1----------
> This is section 2. The current system time is 1080945966646
> ================
> Section 2----------
> This is section 2. The current system time is 1080945967221
>
>
>
> Kaboom!
>
> Scott Johnson
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
James Mitchell
Software Developer / Open Source Evangelist
EdgeTech, Inc.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Tiles String Buffer BUG!
Posted by James Mitchell <jm...@apache.org>.
On Fri, 2 Apr 2004, Scott Johnson wrote:
This seems more appropriate for the dev list, no?
> If you have an empty tiles:put tag in a jsp:
> <tiles:put name="myTile"></tiles:put>
>
> and you call it from a layout jsp:
> <tiles:getAsString name="myTile"/>
>
> You will end up with the last tile displayed from ANY application
> using tiles in your VM. In our case, we have different customers on
> different instances of the same application. Imagine seeing the body
> content from somebody else's instance in yours!
>
> A two-page sample of this bug is as follows:
> ---page 1, the layout page named testLayout.jsp----
> <%@ taglib uri="/layouts/struts-tiles.tld" prefix="tiles" %>
> <HTML>
> <HEAD>
> <TITLE>BUG</TITLE>
> </HEAD>
> <BODY>
> Section 1----------<BR>
> <tiles:getAsString name="section1"/>
>
> <BR>================<BR>
>
> Section 2----------<BR>
> <tiles:getAsString name="section2"/>
> </BODY>
> </HTML>
>
>
> -----page 2, the display page
> <%@ taglib uri="/layouts/struts-tiles.tld" prefix="tiles" %>
> <tiles:insert page="testLayout.jsp" flush="true">
> <tiles:put name="section1"></tiles:put>
> <tiles:put name="section2">
> This is section 2. The current system time is <%=
> System.currentTimeMillis() %>
> </tiles:put>
> </tiles:insert>
>
>
>
> View the display page, then hit reload. After you hit reload, you will
> see something like this:
>
> Section 1----------
> This is section 2. The current system time is 1080945966646
> ================
> Section 2----------
> This is section 2. The current system time is 1080945967221
>
>
>
> Kaboom!
>
> Scott Johnson
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
James Mitchell
Software Developer / Open Source Evangelist
EdgeTech, Inc.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org