[EMAIL PROTECTED] wrote:
dgraham 2003/03/17 18:46:02This introduce an important change in the behavior: until now, a null page was considered as an error, and so an exception was thrown.
Modified: src/share/org/apache/struts/taglib/tiles InsertTag.java
Log:
Only include page if it's != null.
Revision Changes Path
1.14 +13 -5 jakarta-struts/src/share/org/apache/struts/taglib/tiles/InsertTag.java
Index: InsertTag.java
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/tiles/InsertTag.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- InsertTag.java 18 Mar 2003 02:42:59 -0000 1.13
+++ InsertTag.java 18 Mar 2003 02:46:01 -0000 1.14
@@ -871,11 +871,16 @@
if (flush) {
pageContext.getOut().flush();
}
- doInclude(page);
+ + if ((page != null) && (page.length() > 0)) {
+ doInclude(page);
+ }
+
Doing this modification let consider a null page as a valid page value, with no error report !
Personally, I thing that having a null page is an error. Let consider the following declarations:
<tiles:insert page="aPage" /> OK
<tiles:insert /> ERROR !! (but this one is also reported by the tld)
<definition name="aDef" path="aPage" /> OK <definition name="aDef" /> ERROR ! (no report, no exception ;-) )
Checking the struts user list, I suppose you have try to correct a bug encountered with WS 5 where you have something like the following and got a null exception:
<definition name="tiles.leftnav" path="/layout/leftnav.jsp"> <!-- this is the optional secure part of the navigation --> <put name="secureLeftNav" value=""/> </definition>
For me the problem comes from WS 5 that replace the empty string "" by a null reference ;-(.
A solution is to put a blank in the string, and set the flag ignore="true" when inserting the attribute value.
Cedric
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]