Return-Path: Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 31166 invoked by uid 500); 24 Jan 2000 02:22:08 -0000 Delivered-To: apmail-jakarta-tomcat-cvs@jakarta.apache.org Received: (qmail 31163 invoked from network); 24 Jan 2000 02:22:08 -0000 Received: from taz.hyperreal.org (HELO hyperreal.org) (209.133.83.16) by 63.211.145.10 with SMTP; 24 Jan 2000 02:22:08 -0000 Received: (qmail 9768 invoked by uid 2016); 24 Jan 2000 02:22:08 -0000 Delivered-To: apcore-jakarta-tomcat-cvs@apache.org Received: (qmail 9765 invoked from network); 24 Jan 2000 02:22:07 -0000 Received: from unknown (HELO locus.apache.org) (63.211.145.10) by taz.hyperreal.org with SMTP; 24 Jan 2000 02:22:07 -0000 Received: (qmail 31160 invoked by uid 1053); 24 Jan 2000 02:22:06 -0000 Date: 24 Jan 2000 02:22:06 -0000 Message-ID: <20000124022206.31159.qmail@locus.apache.org> From: akv@locus.apache.org To: jakarta-tomcat-cvs@apache.org Subject: cvs commit: jakarta-tomcat/src/share/org/apache/jasper/compiler TagBeginGenerator.java akv 00/01/23 18:22:06 Modified: src/share/org/apache/jasper/compiler TagBeginGenerator.java Log: commit by mandar@eng.sun.com TagHandlers properties to be set at the translation-time can be of any Java type. Before this fix, only String properties could be set. Revision Changes Path 1.8 +15 -15 jakarta-tomcat/src/share/org/apache/jasper/compiler/TagBeginGenerator.java Index: TagBeginGenerator.java =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/TagBeginGenerator.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- TagBeginGenerator.java 1999/11/08 03:14:29 1.7 +++ TagBeginGenerator.java 2000/01/24 02:22:06 1.8 @@ -170,22 +170,22 @@ for(int i = 0; i < attributes.length; i++) { String attrValue = (String) attrs.get(attributes[i].getName()); if (attrValue != null) { - if (attributes[i].canBeRequestTime()) { - if (JspUtil.isExpression(attrValue)) - attrValue = JspUtil.getExpr(attrValue); - else - attrValue = writer.quoteString(attrValue); - } else - attrValue = writer.quoteString(attrValue); - + String attrName = attributes[i].getName(); - Method m = tc.getSetterMethod(attrName); - if (m == null) - throw - new JasperException(Constants.getString("jsp.error.unable.to_find_method", - new Object[] { attrName })); - - writer.println(thVarName+"."+m.getName()+"("+attrValue+");"); + + if (!JspUtil.isExpression (attrValue)) { + writer.println("JspRuntimeLibrary.introspecthelper(" + + thVarName + ",\"" + attrName + + "\",\"" + JspUtil.escapeQueryString(attrValue) + + "\",null,null,false);"); + } else { + + // This requires some careful handling. + // int, boolean, ... are not Object(s). + writer.println("JspRuntimeLibrary.handleSetProperty(" + + thVarName + ",\"" + attrName + + "\"," + JspUtil.getExpr(attrValue) + ");"); + } } } }