I'd also like to see a less hard-coded impl of the default type converters.

On Fri, Oct 21, 2011 at 9:37 PM, Steven Benitez <steven.beni...@gmail.com>wrote:

> 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);
> }
>

Reply via email to