struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Łukasz Lenart <lukasz.len...@googlemail.com>
Subject Re: Proposed ObjectFactory API Change
Date Mon, 24 Oct 2011 07:08:34 GMT
I've never thought about that, maybe it's a better way to improve the
whole type conversion mechanism in Struts2. Instead hardcoded
implementations, Struts2 should use its own approach to create and use
the default type converters.

Steven could you register a ticket with the patch ? I think, it will
be a good starting point :-)


Kind regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/

2011/10/22 Steven Benitez <steven.benitez@gmail.com>:
> Hey, all:
>
> I'd like to propose an API change to ObjectFactory to add a
> buildTypeConverter method. Currently, type converters are created using the
> more general buildBean method. My primary motivation for this is that the
> Google Guice Struts2 plug-in currently fails miserably if you use custom
> type converters, since it makes assumptions about the order in which beans
> are created. (It assumes that all calls to buildInterceptor will occur
> before the first call to buildBean, but with custom type converters that's
> not the case). This change would allow that implementation to be fixed.
>
> Additionally, I think it makes sense, since there are specialized methods
> for building actions, interceptors, results, and validators. What do you all
> think? I can create the JIRA ticket and the patch for this, if you'd like.
>
> I believe type converters are created only in
> XWorkConverter.createTypeConverter() (line 749). Please correct me if you
> know that to be untrue. The current creation of type converters just needs
> the className, but we can add additional parameters if it is believed that
> it would be more flexible for implementations.
>
> /**
>  * Build a TypeConverter of the given type.
>  *
>  * @param className the type of TypeConverter to build
>  */
> public Object buildTypeConverter(String className) throws Exception {
>    return buildBean(className, null);
> }
>

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


Mime
View raw message