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, 13 Apr 2000 19:07:20 GMT
mandar      00/04/13 12:07:20

  Modified:    src/share/org/apache/jasper/compiler Tag: TOMCAT_31
                        TagBeginGenerator.java
  Log:
  proposed errata correction.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.12.2.1  +27 -18    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.12
  retrieving revision 1.12.2.1
  diff -u -r1.12 -r1.12.2.1
  --- TagBeginGenerator.java	2000/04/06 21:05:22	1.12
  +++ TagBeginGenerator.java	2000/04/13 19:07:19	1.12.2.1
  @@ -180,26 +180,35 @@
                   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 (attributes[i].canBeRequestTime() &&
  +			JspUtil.isExpression(attrValue)) {
  +			
  +			// Find the setter method using PropertyDescriptor.
  +			Method m = tc.getSetterMethod(attrName);
  +			
  +			if (m == null)
  +			    throw new JasperException
  +				(Constants.getString
  +				 ("jsp.error.unable.to_find_method",
  +				  new Object[] { attrName }));
  +			
  +			// Invoke the setter method with the attrValue.
  +			attrValue = JspUtil.getExpr(attrValue);
  +			writer.println
  +			    (thVarName+"."+m.getName()+"("+attrValue+");");
  +			
  +		    } else {
  +			
  +			// Conversion is needed.
  +			writer.println("JspRuntimeLibrary.introspecthelper(" +
  +				       thVarName + ", \"" + attrName +
  +				       "\",\"" + JspUtil.escapeQueryString(attrValue) +
  +				       "\",null,null, false);");
  +		    }
  +		}
  +	    }
       }
       
       public void generateServiceMethodStatements(ServletWriter writer) 
  
  
  

Mime
View raw message