Last time I checked (which was a couple of months back), Struts uses the static methods of BeanUtils. This means that they just use the same instance used by all classes for the same application. The same goes for ConvertUtils.register(). So, from what I understand, once you register a converter, that converter becomes active for all BeanUtils calls from that point on, not only for the method that registered the converter, but also for other threads which may be running and using BeanUtils. So if you have ActionA registering ConverterA for java.util.Date, and ActionB registering ConverterB for java.util.Date, and two different users trigger these two actions at roughly the same time, the last converter that got registered is the one that will be called when BeanUtils.copyProperties() gets called.
I only recently became aware of BeanUtils' non-static object counterparts, and I haven't had a chance to use them yet or figure out if Struts can use them. You're right, though. If the same converter will be used throughout the application, then there's no conflict, and it may as well be registered in a plugin. Hubert On Sun, 30 Jan 2005 15:53:28 -0600, Kishore Senji <[EMAIL PROTECTED]> wrote: > > Wouldn't you then run into possible conflicts if you have other areas > > of the code or other forms using BeanUtils? > > May be I misunderstood. I thought he is using that (a > special)converter only for a specific action (registering the > converter inside the execute method) and he wants that converter not > to be there once the action saves the form in the execute. If the > converter is needed for form population or some where else best thing > is to register the converter in a Plugin. > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]