|
From: Kopylenko, D. <dko...@ac...> - 2003-11-19 19:08:30
|
Rajeev, you could use String[] getAliases(String name) throws NoSuchBeanDefinitionException in BeanFactory and catch NoSuchBeanDefinitionException. If caught, then bean does not exist in the factory. Dmitriy. -----Original Message----- From: Rajeev Kaul [mailto:Ra...@cu...] Sent: Wednesday, November 19, 2003 1:54 PM To: spr...@li... Subject: [Springframework-developer] how to determine if a bean exists in registry? Is there an easy way to determine if a certain bean exists in the beanFactory? I know one can use the getBean(name) to determine that, but it seems an expensive call, especially, if there are bean post processors associated with it. Don't you think having a function like boolean containsBean(String beanName) in a beanFactory class would be useful here? Rajeev Kaul |