tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From man...@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/jasper/compiler TagBeginGenerator.java
Date Thu, 06 Apr 2000 18:29:01 GMT
mandar      00/04/06 11:29:00

  Modified:    src/share/org/apache/jasper/compiler TagBeginGenerator.java
  Log:
  Fix for bug #109.
  
  JspRuntimeLibrary breaks taglibs with multiple property setters.
  
  Revision  Changes    Path
  1.11      +17 -14    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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- TagBeginGenerator.java	2000/03/28 04:29:48	1.10
  +++ TagBeginGenerator.java	2000/04/06 18:29:00	1.11
  @@ -179,21 +179,24 @@
                   String attrValue = (String) attrs.get(attributes[i].getName());
                   if (attrValue != null) {
   		    
  -                    String attrName = attributes[i].getName();
  +		    if (attributes[i].canBeRequestTime()) {
  +			if (JspUtil.isExpression(attrValue))
  +			    attrValue = JspUtil.getExpr(attrValue);
  +			else
  +			    attrValue = writer.quoteString(attrValue);
  +		    } else
  +			attrValue = writer.quoteString(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) + ");");
  -		    }
  +		    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+");");
                   }
               }
       }
  
  
  

Mime
View raw message