luehe 2002/09/11 11:07:13 Modified: jasper2/src/share/org/apache/jasper/compiler Generator.java Log: Fixed 12466: Unable to call jsp:invoke in the body of a classic/simple tag in a tag file. Fixed 12467: Unable to call jsp:invoke withing a classic tag handler in a tag file Revision Changes Path 1.98 +28 -9 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java Index: Generator.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v retrieving revision 1.97 retrieving revision 1.98 diff -u -r1.97 -r1.98 --- Generator.java 10 Sep 2002 21:52:35 -0000 1.97 +++ Generator.java 11 Sep 2002 18:07:13 -0000 1.98 @@ -1852,10 +1852,10 @@ String varAttr = n.getTextAttribute("var"); if (varReaderAttr != null || varAttr != null) { out.printil("_jspx_sout = new java.io.StringWriter();"); - out.print(toGetterMethod(n.getTextAttribute("fragment"))); + out.printin(toGetterMethod(n.getTextAttribute("fragment"))); out.println(".invoke(_jspx_sout, _jspx_params);"); } else { - out.print(toGetterMethod(n.getTextAttribute("fragment"))); + out.printin(toGetterMethod(n.getTextAttribute("fragment"))); out.println(".invoke(null, _jspx_params);"); } @@ -2921,7 +2921,29 @@ out.println(); out.pushIndent(); - // Class body begins here + /* + * Class body begins here + */ + + // Declare parameter map for fragment/body invocation. This must be + // declared as an instance variable (as opposed to a local variable in + // doTag()), so that it is accessible: + // + // - from the JspFragmentHelper subclass specific to the automatically + // generated tag handler, in case the fragment/body invocation is + // contained in a fragment body, as in: + // <my:simple> + // <jsp:invoke fragment="frag"/> + // </my:simple> + // + // - from the invocation of a classic tag handler that is separated out + // into its own method, if the fragment/body invocation is + // encapsulated in a custom action, as in: + // <my:classic> + // <jsp:invoke fragment="frag"/> + // </my:classic> + out.printil("private java.util.Map _jspx_params = null;"); + generateDeclarations(tag); // Static initializations here @@ -2961,9 +2983,6 @@ out.printil("javax.servlet.ServletConfig config = " + "pageContext.getServletConfig();"); - // Declare parameter map for fragment/body invocation - out.printil("java.util.Map _jspx_params = null;"); - // Declare writer used for storing result of fragment/body invocation // if 'varReader' or 'var' attribute is specified out.printil("java.io.Writer _jspx_sout = null;");
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>