tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Howard M. Lewis Ship" <hls...@comcast.net>
Subject RE: ExpressionBinding type conversion patch
Date Tue, 18 Nov 2003 17:08:43 GMT
I'd like to see a unit test related to this change.

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry
http://jakarta.apache.org/commons/sandbox/hivemind/
http://javatapestry.blogspot.com

> -----Original Message-----
> From: Erik Hatcher [mailto:erik@ehatchersolutions.com] 
> Sent: Tuesday, November 18, 2003 8:51 AM
> To: tapestry-dev@jakarta.apache.org
> Subject: ExpressionBinding type conversion patch
> 
> 
> I know I'm a committer, but this is my first change to Tapestry's  
> actual functionality... so being a good citizen, I'm asking if the  
> below patch is ok to commit or not.  I've tested in on our 
> system and  
> it works wonderfully.
> 
> The dilemma is that a configured TypeConverter would not be 
> used when  
> OgnlUtils is used directly, only for expression bindings.  
> This is ok  
> for our current needs though.
> 
> Anyone object to this patch being made?
> 
> Thanks,
> 	Erik
> 
> 
> RCS file:  
> /home/cvs/jakarta-tapestry/framework/src/org/apache/tapestry/binding/ 
> ExpressionBinding.java,v
> retrieving revision 1.8
> diff -u -w -b -r1.8 ExpressionBinding.java
> ---  
> framework/src/org/apache/tapestry/binding/ExpressionBinding.java   4  
> Nov 200315:09:37-0000  1.8
> +++  
> framework/src/org/apache/tapestry/binding/ExpressionBinding.ja
> va   18  
> Nov 200316:34:58-0000
>      private Map getOgnlContext()
> 
>      {
> -        if (_context == null)
> +        if (_context == null) {
>              _context = Ognl.createDefaultContext(_root, _resolver);
> +        }
> +
> +        IApplicationSpecification appSpec =  
> _root.getPage().getEngine().getSpecification();
> +        if (appSpec.checkExtension(Tapestry.OGNL_TYPE_CONVERTER)) {
> +            TypeConverter typeConverter = (TypeConverter)  
> appSpec.getExtension(Tapestry.OGNL_TYPE_CONVERTER, null);
> +            Ognl.setTypeConverter(_context, typeConverter);
> +        }
> 
>          return _context;
>      }
> 
> Index: framework/src/org/apache/tapestry/Tapestry.java
>      /**
> +     * Class name of an {@link ognl.TypeConverter} implementing class
> +     * to use as a type converter for {@link  
> org.apache.tapestry.binding.ExpressionBinding}
> +     */
> +    public static final String OGNL_TYPE_CONVERTER =
> +        "org.apache.tapestry.ognl-type-converter";
> +
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


Mime
View raw message