Ранее я выполнял вход в систему и регистрировался в проекте уровня безопасности в 2017 году с использованием WebMvcConfigurerAdapter, однако теперь это устарело, я изо всех сил пытаюсь обновить код.
@Configuration
public class WebConfig extends WebMvcConfigurerAdapter {
// Handles HTTP GET requests for /resources/** by efficiently serving up static
// resources in the ${webappRoot}/resources/ directory
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/resources/**").addResourceLocations("/resources/");
}
//Resolves views selected for rendering by @Controllers to .jsp resources in the
// /WEB-INF/views directory
@Bean
public InternalResourceViewResolver viewResolver() {
InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
viewResolver.setViewClass(JstlView.class);
viewResolver.setPrefix("/WEB-INF/views/");
viewResolver.setSuffix(".jsp");
viewResolver.setOrder(2);
return viewResolver;
}
@Bean
public SimpleMappingExceptionResolver simpleMappingExceptionResolver()
{
SimpleMappingExceptionResolver b = new SimpleMappingExceptionResolver();
Properties mappings = new Properties();
mappings.put("eMarket.controller.SpringException", "form/ExceptionPage");
mappings.put("defaultErrorView", "form/error");
b.setExceptionMappings(mappings);
return b;
}
}
Я пытался использовать
@Configuration
public class WebConfig implements WebMvcConfigurer { ... }
Когда я делаю это, возникают следующие ошибки:
- The type WebConfig must implement the inherited abstract method
WebMvcConfigurer.configureContentNegotiation(ContentNegotiationConfigurer)
- The type WebConfig must implement the inherited abstract method WebMvcConfigurer.getValidator()
- The type WebConfig must implement the inherited abstract method
WebMvcConfigurer.extendMessageConverters(List<HttpMessageConverter<?>>)
- The type WebConfig must implement the inherited abstract method
WebMvcConfigurer.addCorsMappings(CorsRegistry)
- The type WebConfig must implement the inherited abstract method
WebMvcConfigurer.addArgumentResolvers(List<HandlerMethodArgumentResolver>)
- The type WebConfig must implement the inherited abstract method
WebMvcConfigurer.addInterceptors(InterceptorRegistry)
- The type WebConfig must implement the inherited abstract method
WebMvcConfigurer.getMessageCodesResolver()
- The type WebConfig must implement the inherited abstract method
WebMvcConfigurer.configureHandlerExceptionResolvers(List<HandlerExceptionResolver>)
- The type WebConfig must implement the inherited abstract method
WebMvcConfigurer.configureDefaultServletHandling(DefaultServletHandlerConfigurer)
- The type WebConfig must implement the inherited abstract method
WebMvcConfigurer.configurePathMatch(PathMatchConfigurer)
- The type WebConfig must implement the inherited abstract method
WebMvcConfigurer.addFormatters(FormatterRegistry)
- The type WebConfig must implement the inherited abstract method
WebMvcConfigurer.addReturnValueHandlers(List<HandlerMethodReturnValueHandler>)
- The type WebConfig must implement the inherited abstract method
WebMvcConfigurer.configureMessageConverters(List<HttpMessageConverter<?>>)
- The type WebConfig must implement the inherited abstract method
WebMvcConfigurer.configureViewResolvers(ViewResolverRegistry)
- The type WebConfig must implement the inherited abstract method
WebMvcConfigurer.configureAsyncSupport(AsyncSupportConfigurer)
- The type WebConfig must implement the inherited abstract method
WebMvcConfigurer.extendHandlerExceptionResolvers(List<HandlerExceptionResolver>)
- The type WebConfig must implement the inherited abstract method
WebMvcConfigurer.addViewControllers(ViewControllerRegistry)
Идеи о том, почему будет цениться