<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=adb" rel="nofollow">Antony Bowesman</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-5362?redirect=false" rel="nofollow">SPR-5362</a></strong> and commented</p>
<p dir="auto">Reference forum message <a href="http://forum.springsource.org/showthread.php?t=64011" rel="nofollow">http://forum.springsource.org/showthread.php?t=64011</a></p>
<p dir="auto">Given the following two methods in a Controller</p>
<p dir="auto"><code class="notranslate">@RequestMapping</code>(value="/rest/mail/v1/ipm/*", method=RequestMethod.GET)<br>
public ModelAndView Method1()</p>
<p dir="auto"><code class="notranslate">@RequestMapping</code>(value="/rest/mail/v1/ipm/*/**", method=RequestMethod.GET)<br>
public ModelAndView Method2()</p>
<p dir="auto">Given the request path /rest/mail/v1/ipm/JA8AAAAAAAAAKwAB4awBIfRXAeRU it matches the first method, but then chooses the second path as a <em>BETTER</em> match, resulting in the wrong method being called.  This is because of the simplistic implementation of isBetterPathMatch() that decides that a longer length path is a better match regardless of the number of elements in the path.</p>
<p dir="auto">This occurs in AnnotationMethodHandlerAdapter.ServletHandlerMethodResolver.isBetterPathMatch.  It clearly does not take account of the extra / in the second path, which is not present in the given URL.</p>
<p dir="auto">Although it is possible to make a workaround which involves having a single method, where the code then makes decisions based on the request path, it complicates Controller implementations forcing different sets of business logic to be combined.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.5.6</p>
<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="398092440" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/10040" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/10040/hovercard" href="https://github.com/spring-projects/spring-framework/issues/10040">#10040</a> PathVariable mappings are greedy over hard coded mappings (<em><strong>"duplicates"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398096226" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/10593" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/10593/hovercard" href="https://github.com/spring-projects/spring-framework/issues/10593">#10593</a> REOPENED -PathVariable mappings are greedy over hard coded mappings (<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/721f2ca63ec0867eaaac7a63c3f071f3ef0cf91f/hovercard" href="https://github.com/spring-projects/spring-framework/commit/721f2ca63ec0867eaaac7a63c3f071f3ef0cf91f"><tt>721f2ca</tt></a></p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=sivabbl" rel="nofollow">Sivakumar</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-4848?redirect=false" rel="nofollow">SPR-4848</a></strong> and commented</p>
<p dir="auto">Can any one send replace ment method fororg.springframework.jdbc.core.ResultReader in spring 2.5.4</p>
<hr>
<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="398088618" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/9528" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/9528/hovercard" href="https://github.com/spring-projects/spring-framework/issues/9528">#9528</a> New class for org.springframework.jdbc.core.ResultReader; in spring 2.5.4 (<em><strong>"is duplicated by"</strong></em>)</li>
</ul>