Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What is the correct way to invoke Beans.instantiate()?

invoke
0
Posted

What is the correct way to invoke Beans.instantiate()?

0

Location: http://www.jguru.com/faq/view.jsp?EID=704314 Created: Dec 28, 2001 Author: Govind Seshadri (http://www.jguru.com/guru/viewbio.jsp?EID=14) Typically, you should invoke the method as: Beans.instantiate(this.getClass().getClassLoader(), yourBeanName) Beans.instantiate() basically loads a class, creates a Class object, and then n instantiates an object of that class. If the Bean name corresponds to a serialized Bean prototype, it uses that prototype. Otherwise the instantiation uses a zero-argument constructor. When invoking instantiate(), you should ensure that you have specified the correct name for the class. Also, the class should have public scope and should contain a no-arg constructor.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123