<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=olivergierke" rel="nofollow">Oliver Drotbohm</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-6467?redirect=false" rel="nofollow">SPR-6467</a></strong> and commented</p>
<p dir="auto">Currently <code class="notranslate">ContentNegotiatingViewResolver</code> acts lenient as it returns <code class="notranslate">null</code> when it can not resolve any view to indicate that further <code class="notranslate">ViewResolvers</code> configured shall step in and try to resolve the view.</p>
<p dir="auto">In cases when <code class="notranslate">ContentNegotiatingViewResolver</code> is the only resolver configured, not resolving the view should be answered with a <code class="notranslate">406 Not Acceptable</code> status code. A quick hack I did was to add a property <code class="notranslate">beStrict</code> to <code class="notranslate">CNVR</code> an implement an inner class to return the appropriate statuscode. See applied patch.</p>
<p dir="auto">This solves the problem at a first glance but I think it would be more clean to prevent processing of the request entirely if no valid accept header was set by using the algorithm <code class="notranslate">getmediaTypes(..)</code> in <code class="notranslate">CNVR</code>. Currently this method is not public, but I could imagine a <code class="notranslate">HandlerInterceptor</code> implementation that gets a reference to the <code class="notranslate">CNVR</code> injected and call to <code class="notranslate">getMediaType(..)</code> to decide whether to process the request at all.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0 RC2</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/15972/bestrict.patch" rel="nofollow">bestrict.patch</a> (<em>2.43 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="398103256" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/11559" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/11559/hovercard" href="https://github.com/spring-projects/spring-framework/issues/11559">#11559</a> exotic MIME-Type leads to 500 Internal Server Error (<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-framework/commit/1cd0a9750da46d35a6ff8eadccb4d3be22afeb9e/hovercard" href="https://github.com/spring-projects/spring-framework/commit/1cd0a9750da46d35a6ff8eadccb4d3be22afeb9e"><tt>1cd0a97</tt></a></p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=cbeams" rel="nofollow">Chris Beams</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-9779?redirect=false" rel="nofollow">SPR-9779</a></strong> and commented</p>
<p dir="auto">Per email.</p>
<hr>
<p dir="auto">This issue is a sub-task of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398152666" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/14349" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/14349/hovercard" href="https://github.com/spring-projects/spring-framework/issues/14349">#14349</a></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="398153157" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/14417" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/14417/hovercard" href="https://github.com/spring-projects/spring-framework/issues/14417">#14417</a> Upgrade to JUnit 4.11 snapshot in support of JDK7 (<em><strong>"depends on"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398152667" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/14350" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/14350/hovercard" href="https://github.com/spring-projects/spring-framework/issues/14350">#14350</a> Build against JDK 7, test against JDK 6+7 (<em><strong>"is depended on by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398154857" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/14625" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/14625/hovercard" href="https://github.com/spring-projects/spring-framework/issues/14625">#14625</a> AdvisorAdapterRegistrationTests fails intermittently under Java 7 (<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="398154857" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/14625" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/14625/hovercard" href="https://github.com/spring-projects/spring-framework/issues/14625">#14625</a> AdvisorAdapterRegistrationTests fails intermittently under Java 7</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/a9a90cabadfe8059bbae595645108c739362bc80/hovercard" href="https://github.com/spring-projects/spring-framework/commit/a9a90cabadfe8059bbae595645108c739362bc80"><tt>a9a90ca</tt></a></p>