Note that there are some explanatory texts on larger screens.

plurals
  1. PODoes Spring allow convert abstract bean in non-abstract?
    primarykey
    data
    text
    <p>My application can run on different environments. I need configure MY data model per environment. The data model is build using Spring beans. </p> <p>I use Spring 3.0.5, so I cannot conditionally load resources. I have this:</p> <pre><code>&lt;bean id="Template1" class="... .............. &lt;/bean&gt; &lt;bean id="Template2" class="... .............. &lt;/bean&gt; &lt;bean id="Template3" class="... .............. &lt;/bean&gt; ................ &lt;bean id="Factory" ...&gt; &lt;propety name="type"&gt;&lt;value&gt;${app.type}&lt;/value&gt;&lt;/property&gt; &lt;property&gt; &lt;map&gt; &lt;entry key="Temlate1" value-ref="Template1"&gt; &lt;entry key="Temlate2" value-ref="Template1"&gt; &lt;entry key="Temlate3" value-ref="Template1"&gt; .................. </code></pre> <p>Real bean I create by factory:</p> <pre><code>&lt;bean id="real" factory="Factory" factory-method="getInstance" &lt;constructor-arg&gt;Factory&lt;/..... ............. &lt;/bean&gt; </code></pre> <p>Java code:</p> <pre><code>class Factory { private Map&lt;String, Object&gt; templateBeans; Object getInstance(String name) { return templateBeans.get(name); ........... </code></pre> <p>Is it possible in some way to declare abstract template beans? Because I have very big problem with memory. Does another way exist to instantiate different beans conditionally in Spring before version 3.1? It would be good to use only EL because I don't have access to the Java code of the beans as they are from a third-party library.</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.
 

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