You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Craig McClanahan <cr...@gmail.com> on 2005/07/12 08:00:54 UTC

Re: Using struts forms as Value Objects: your opinion? BeanUtil C onverter

On 7/11/05, Nitish Kumar <ni...@tavant.com> wrote:
> 
> "This is a HUGE problem with BeanUtils and why I end up having to
> register custom converters:("
> 
> good point, but where do I register my custom converters? I dont want to do
> it in my action classes, and writing a plugin just to register my converters
> would be a big overhead.
> 

I guess I have a pretty hard time understanding why this is a "big
overhead".  Writing a Struts plugin is about the same amount of effort
as writing a ServletContextListener implementation to do the same
thing (which is the better approach if you're on a Servlet 2.3 or
later container).

But, the key point is that either way it's a pretty simple method
declaration, plus one line of code for each converter you want to
register.

> Why cant we have declative registration through struts-config.xml, just like
> other components and struts should take care of registering my converters
> with ConvertUtil? (If its not already done yet!)
> 
> This would actually give me flexibility to have my custom types as well in
> the form bean.
> 
> Lets say, for some application I want all java.util.Long types to be
> appended with "$" symbol, it becomes much easier with a converter.
> 
> what do you say?
> 

That's certainly possible to implement ... and I'm sure the Struts
developer community would consider an RFE plus a patch to make it
possible.  But, to me personally, this isn't the highest possible
return you can get from using a framework, so it wouldn't surprise me
if the Struts developers focused on different areas first.

In the mean time, if you want to get any attention to this issue, the
starting point would be to file an RFE in the issue tracking system
<http://issues.apache.org/bugzilla>.

> Thanks and Regards,
> Nitish Kumar
> 

Craig

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