Hi José,

You can put @Inject in the constructor you want Tapestry to use for auto-instantiation. Should solve your problem.

-Filip

On 2008-05-28 15:59, José Paumard wrote:
Hello Marcus,

Thank you for your answer, but the customization provided by the BeanModel are about properties, their orders etc... A bean is built by a call to newInstance, defined in the BeanModel interface. The way the bean is built comes from InternalUtils.findAutobuildConstructor. This class choses a constructor with a given algorithm, namely it choses the constructor with the largest number of arguments.

Then T5 tries to match the arguments it needs with the services it has at hand. This approach is smart, but it would need a major refactoring of the object (old and legacy) model I already have, so I dont want to use it.

It would be great if I could write something like

   configuration.add(MyBean.class, "constructor", myBeanConstructor) ;

to tell T5 what constructor I want to see used for what class, or

   configuration.add(MyBean.class, BeanModel.class, MyBeanModelImpl.class)

to tell T5 that for MyBean.class, I want to use the given implementation of bean model, in that case I could overide the newInstance method. But BeanModelImpl is in the internal package, so this would be a less robust approach.

Thank you,

José

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to