After upgrading my Spring MVC application to Spring 3.2 I\'m getting the following exception when accessing some of my URLs:
org.springframework.web.HttpMediaTyp
You need to add a proper MessageConverter
to your configuration, along with one you might already have for Jackson.
e.g. in your subclass of WebMvcConfigurerAdapter
:
@Override
public void configureMessageConverters(final List> converters) {
converters.add(new StringHttpMessageConverter());
}
When you still keep the favorPathExtension
option turned on, you won't require a produces
parameter as well, your controller will return application/javascript
.
The hints in Aleksanders answer actually did not help me getting rid of the 406 when I had the same problem.