Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing Spring Factory bean pattern - no bean return null?
    primarykey
    data
    text
    <p>I am using Factory pattern in SPRING like in this example <a href="http://kh-yiu.blogspot.co.il/2013/04/spring-implementing-factory-pattern.html" rel="nofollow">http://kh-yiu.blogspot.co.il/2013/04/spring-implementing-factory-pattern.html</a></p> <p>In case that there is no bean with specific name I get exception org.springframework.beans.factory.NoSuchBeanDefinitionException</p> <pre><code>org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'XXX' is defined at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:549) at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1095) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:277) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) at org.springframework.beans.factory.config.ServiceLocatorFactoryBean$ServiceLocatorInvocationHandler.invokeServiceLocatorMethod(ServiceLocatorFactoryBean.java:367) at org.springframework.beans.factory.config.ServiceLocatorFactoryBean$ServiceLocatorInvocationHandler.invoke(ServiceLocatorFactoryBean.java:356) at com.sun.proxy.$Proxy24.createManualDepositProcess(Unknown Source) </code></pre> <p>I get exceptions in case I try to get bean that not defined, like printStrategyFactory.getStrategy("NO_DEF").print(doc);</p> <p>Is it possible in case that there is <strong>no bean - return null ?</strong> Thank you !</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload