31 lines
1.1 KiB
Java
31 lines
1.1 KiB
Java
package com.baeldung.spring43.attributeannotations;
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
import org.springframework.context.annotation.ComponentScan;
|
|
import org.springframework.context.annotation.Configuration;
|
|
import org.springframework.web.servlet.ViewResolver;
|
|
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
|
import org.springframework.web.servlet.view.InternalResourceViewResolver;
|
|
|
|
@Configuration
|
|
@ComponentScan
|
|
@EnableWebMvc
|
|
public class AttributeAnnotationConfiguration extends WebMvcConfigurerAdapter {
|
|
|
|
@Bean
|
|
public ViewResolver viewResolver() {
|
|
InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
|
|
viewResolver.setPrefix("/WEB-INF/jsp/view/");
|
|
viewResolver.setSuffix(".jsp");
|
|
return viewResolver;
|
|
}
|
|
|
|
@Override
|
|
public void addInterceptors(InterceptorRegistry registry) {
|
|
registry.addInterceptor(new ParamInterceptor());
|
|
}
|
|
|
|
}
|