argos/dmp-backend/src/main/java/eu/eudat/configurations/WebMVCConfiguration.java

31 lines
1.1 KiB
Java

package eu.eudat.configurations;
import eu.eudat.handlers.PrincipalArgumentResolver;
import eu.eudat.services.AuthenticationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
import org.springframework.boot.web.servlet.ErrorPage;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpStatus;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import java.util.List;
/**
* Created by ikalyvas on 12/15/2017.
*/
@Configuration
public class WebMVCConfiguration extends WebMvcConfigurerAdapter {
@Autowired
AuthenticationService authenticationService;
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
argumentResolvers.add(new PrincipalArgumentResolver(this.authenticationService));
}
}