Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The best way I can think of is to configure your RequestMappingHandlerMapping explicitly to not consider suffixpaths, this way:</p> <pre><code>&lt;bean name="handlerMapping" class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping"&gt; &lt;property name="useSuffixPatternMatch" value="false"&gt;&lt;/property&gt; &lt;/bean&gt; </code></pre> <p>However, if you have configured your Spring MVC using <code>mvc:annotation-driven</code>, this will not work, you will have to expand out the entire handlerAdapter definition, which is not that difficult to do, along these lines(this is not complete, you can look through <code>org.springframework.web.servlet.config.AnnotationDrivenBeanDefinitionParser</code> for the entire definition):</p> <pre><code>&lt;bean name="handlerAdapter" class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter"&gt; &lt;property name="webBindingInitializer"&gt; &lt;bean class="org.springframework.web.bind.support.ConfigurableWebBindingInitializer"&gt; &lt;property name="conversionService" ref="conversionService"&gt;&lt;/property&gt; &lt;property name="validator"&gt; &lt;bean class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"/&gt; &lt;/property&gt; &lt;/bean&gt; &lt;/property&gt; &lt;property name="messageConverters"&gt; &lt;list&gt; &lt;bean class="org.springframework.http.converter.ByteArrayHttpMessageConverter"&gt;&lt;/bean&gt; &lt;bean class="org.springframework.http.converter.StringHttpMessageConverter"&gt;&lt;/bean&gt; &lt;bean class="org.springframework.http.converter.ResourceHttpMessageConverter"&gt;&lt;/bean&gt; &lt;bean class="org.springframework.http.converter.xml.SourceHttpMessageConverter"&gt;&lt;/bean&gt; &lt;bean class="org.springframework.http.converter.xml.XmlAwareFormHttpMessageConverter"&gt;&lt;/bean&gt; &lt;bean class="org.springframework.http.converter.xml.Jaxb2RootElementHttpMessageConverter"&gt;&lt;/bean&gt; &lt;bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"&gt;&lt;/bean&gt; &lt;/list&gt; &lt;/property&gt; &lt;/bean&gt; &lt;bean name="handlerMapping" class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping"&gt; &lt;property name="useSuffixPatternMatch" value="false"&gt;&lt;/property&gt; &lt;/bean&gt; </code></pre>
 

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