luehe 2004/05/07 12:37:36 Modified: jasper2/src/share/org/apache/jasper/compiler TagLibraryInfoImpl.java Log: Fix for Bugtraq 5043820 ("when fragment element is used, type and rtexprvalue are not set correctly") Patch provided by: [EMAIL PROTECTED] Revision Changes Path 1.55 +15 -1 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java Index: TagLibraryInfoImpl.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java,v retrieving revision 1.54 retrieving revision 1.55 diff -u -r1.54 -r1.55 --- TagLibraryInfoImpl.java 7 May 2004 17:09:53 -0000 1.54 +++ TagLibraryInfoImpl.java 7 May 2004 19:37:36 -0000 1.55 @@ -532,8 +532,9 @@ } } else if ("fragment".equals(tname)) { String s = element.getBody(); - if (s != null) + if (s != null) { isFragment = JspUtil.booleanValue(s); + } } else if ("description".equals(tname) || // Ignored elements false) { ; @@ -543,6 +544,19 @@ "jsp.warning.unknown.element.in.attribute", tname)); } } + } + + if (isFragment) { + /* + * According to JSP.C-3 ("TLD Schema Element Structure - tag"), + * 'type' and 'rtexprvalue' must not be specified if 'fragment' + * has been specified (this will be enforced by validating parser). + * Also, if 'fragment' is TRUE, 'type' is fixed at + * javax.servlet.jsp.tagext.JspFragment, and 'rtexprvalue' is + * fixed at true. See also JSP.8.5.2. + */ + type = "javax.servlet.jsp.tagext.JspFragment"; + rtexprvalue = true; } if (!rtexprvalue) {
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]