<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=nurkiewicz" rel="nofollow">Tomasz Nurkiewicz</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-8943?redirect=false" rel="nofollow">SPR-8943</a></strong> and commented</p>
<p dir="auto">Spring 3.1 introduces several <code class="notranslate">@Enable*</code> annotations. However this code snippet:</p>
<div class="highlight highlight-text-xml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;context:mbean-export/&gt;"><pre class="notranslate">&lt;<span class="pl-ent">context</span><span class="pl-ent">:</span><span class="pl-ent">mbean-export</span>/&gt;</pre></div>
<p dir="auto">cannot be expressed with annotations. There is a valid simple workaround:</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@Bean
public AnnotationMBeanExporter annotationMBeanExporter() {
    return new AnnotationMBeanExporter();
}"><pre class="notranslate"><span class="pl-c1">@</span><span class="pl-c1">Bean</span>
<span class="pl-k">public</span> <span class="pl-smi">AnnotationMBeanExporter</span> <span class="pl-s1">annotationMBeanExporter</span>() {
    <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-smi">AnnotationMBeanExporter</span>();
}</pre></div>
<p dir="auto">but it would be nice to have built-in <code class="notranslate">@Enable...</code> annotation. Note that in JavaConfig project there was <code class="notranslate">@MBeanExport</code> <a href="http://static.springsource.org/spring-javaconfig/docs/1.0.0.M4/javadoc-api/org/springframework/config/java/plugin/context/MBeanExport.html" rel="nofollow">annotation</a>.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.1 GA</p>
<p dir="auto"><strong>Sub-tasks:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398154317" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/14552" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/14552/hovercard" href="https://github.com/spring-projects/spring-framework/issues/14552">#14552</a> Document <code class="notranslate">@EnableMBeanExport</code> in reference manual</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="398112208" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/12963" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/12963/hovercard" href="https://github.com/spring-projects/spring-framework/issues/12963">#12963</a> Provide <code class="notranslate">@Configuration</code> support for automatic MBean registration (<em><strong>"is duplicated by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398180827" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/17728" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/17728/hovercard" href="https://github.com/spring-projects/spring-framework/issues/17728">#17728</a> Add an enum for MBeanExporter Autodetect Mode</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/0bd4dab4e3326be511d5a9e9cecdfa8279935993/hovercard" href="https://github.com/spring-projects/spring-framework/commit/0bd4dab4e3326be511d5a9e9cecdfa8279935993"><tt>0bd4dab</tt></a>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/d52e86853026fa66cf9e7a8cfdc38791c80d93c4/hovercard" href="https://github.com/spring-projects/spring-framework/commit/d52e86853026fa66cf9e7a8cfdc38791c80d93c4"><tt>d52e868</tt></a>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/5d4d1eaca4fa8af29f07e23b89bee8fd028820bd/hovercard" href="https://github.com/spring-projects/spring-framework/commit/5d4d1eaca4fa8af29f07e23b89bee8fd028820bd"><tt>5d4d1ea</tt></a>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/cae08db6a9808bf9708d8bfd69417f792d4b06b6/hovercard" href="https://github.com/spring-projects/spring-framework/commit/cae08db6a9808bf9708d8bfd69417f792d4b06b6"><tt>cae08db</tt></a></p>
<p dir="auto">5 votes, 3 watchers</p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=ndemengel" rel="nofollow">Nicolas Demengel</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-7589?redirect=false" rel="nofollow">SPR-7589</a></strong> and commented</p>
<p dir="auto">Hi people,</p>
<p dir="auto">I might have found an odd behavior in the AbstractUrlHandlerMapping class : given two controllers, one annotated with <code class="notranslate">@RequestMapping</code>("/**") and the another one annotated with <code class="notranslate">@RequestMapping</code>("/access/{resourceType}/{resourceSubType}/{resourceName}"), when the path "/access/document/text/sometextdocument" is evaluated I would expect the second controller to be chosen to handle the request but it is the first one that is taken.</p>
<p dir="auto">Looking at the code of AbstractUrlHandlerMapping.lookupHandler() one can see that when several patterns are found that match the path, they are ordered using an AntPatternComparator to find the most pertinent one for it. Digging in further, this comparator orders patterns based on their level of incertitude, counting the occurrences of wildcards and brackets. In my opinion it should read patterns as we do (i.e. from left to right in our countries) to see if the pattern start makes it more suitable to handle the path that is evaluated.</p>
<p dir="auto">I attached a JUnit test to illustrate my point.</p>
<p dir="auto">Thanks</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0.4</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/17132/AntPatternComparatorTest.java" rel="nofollow">AntPatternComparatorTest.java</a> (<em>1.45 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="398102244" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/11407" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/11407/hovercard" href="https://github.com/spring-projects/spring-framework/issues/11407">#11407</a> RequestMapping with 3 PathVariable doesn't work (<em><strong>"duplicates"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398114462" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13325" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13325/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13325">#13325</a> AntPathMatcher.AntPatternComparator algorithm wrong for hierarchical matches</li>
</ul>
<p dir="auto">1 votes, 1 watchers</p>