<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=alef.arendsen" rel="nofollow">Alef Arendsen</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-4?redirect=false" rel="nofollow">SPR-4</a></strong> and commented</p>
<p dir="auto">Mike's been talking about introducing OGNL support. Seems like a nice idea to me, though not really feasible for the 1.0 release I think. But hey, let's put it in here so we won't forget...</p>
<p dir="auto">Mike's mail (December 2nd):</p>
<hr>
<p dir="auto">Or an even better idea... how about supporting OGNL within the Spring config files? (like Xwork does)</p>
<p dir="auto">This would be <em>awesome</em> and I just found a second use case for it (the very minute Rob's email came in).</p>
<p dir="auto">My use case - Maps.</p>
<p dir="auto">The Map syntax is nice, but not very useful in practicality I'm finding as the key and value of the map are usually related, for instance I often want to put a list of referenced beans into a map, with ref.getName() (or some<br>
method) called for the key.</p>
<p dir="auto">At the moment I have to add a setBeans(List) method to my class, and then in that setter iterate and add to a map - smelly!</p>
<p dir="auto">If we allowed OGNL expressions, it would be very simple to do this in the config file itself:</p>
<p dir="auto">&lt;property value="myMapProp"&gt;<br>
&lt;map&gt;<br>
&lt;entry&gt;<br>
&lt;key&gt;$referencedBean.name&lt;/key&gt;<br>
&lt;value&gt;&lt;ref bean="referencedBean" /&gt;&lt;/value&gt;<br>
&lt;/entry&gt;<br>
... More entries<br>
&lt;/map&gt;<br>
&lt;/property&gt;</p>
<p dir="auto">I'm sure there are a million other places where OGNL would be useful too, but AFAIK the above can't be done <em>without</em> it?</p>
<p dir="auto">Or have I just been at this desk far too long?</p>
<p dir="auto">M</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 1.0 M4</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/10439/patch.zip" rel="nofollow">patch.zip</a> (<em>4.40 kB</em>)</li>
</ul>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398057296" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/5713" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/5713/hovercard" href="https://github.com/spring-projects/spring-framework/issues/5713">#5713</a> Introduce OGNL and OgnlExpressionFactoryBean  (<em><strong>"is duplicated by"</strong></em>)</li>
</ul>
<p dir="auto"><strong>Referenced from:</strong> commits <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-integration/commit/e57103466e24ca97886e8c061b28e31070e24ff8/hovercard" href="https://github.com/spring-projects/spring-integration/commit/e57103466e24ca97886e8c061b28e31070e24ff8">spring-projects/spring-integration@<tt>e571034</tt></a></p>
<p dir="auto">8 votes, 6 watchers</p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=mattk" rel="nofollow">Kilian Matt</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-9630?redirect=false" rel="nofollow">SPR-9630</a></strong> and commented</p>
<p dir="auto">I tried to migrate an existing spring application from 3.0.5 to 3.1.2 and I've noticed a strange bug, that the injection of a provider works the first time but passes subsequent times.</p>
<p dir="auto">It seems due the call of DependencyDescriptor.increaseNestingLevel() in the constructor of DependencyObjectFactory. Since the Descriptor is cached, the subsequent calls to BeanFactory.resolveDependency no longer return a Provider, but a reference to the bean.</p>
<p dir="auto">I've attached a testcase, which reproduces the problem. The bug seems to be introduced in 3.1.1, according to my tests.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.1.1</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/20125/ProviderInjectionTest.java" rel="nofollow">ProviderInjectionTest.java</a> (<em>1.82 kB</em>)</li>
</ul>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398117666" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13819" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13819/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13819">#13819</a> <code class="notranslate">@Inject</code> Provider or <code class="notranslate">@Autowired</code> ObjectFactory issue with session scoped bean (<em><strong>"duplicates"</strong></em>)</li>
</ul>
<p dir="auto"><strong>Referenced from:</strong> commits <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/65743936ffd87d0e621722c414692c3fe9652717/hovercard" href="https://github.com/spring-projects/spring-framework/commit/65743936ffd87d0e621722c414692c3fe9652717"><tt>6574393</tt></a>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/d7825586dc1793da9ebfec4430356e73d428e7bd/hovercard" href="https://github.com/spring-projects/spring-framework/commit/d7825586dc1793da9ebfec4430356e73d428e7bd"><tt>d782558</tt></a></p>
<p dir="auto">2 votes, 7 watchers</p>