首页>代码>SpringBoot+Security实现sso单点登录项目实例>/Client1/src/main/java/com/voicecyber/client1/config/Client1WebConfig.java
package com.voicecyber.client1.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; import org.springframework.web.servlet.config.annotation.*; /** * @Author: YafengLiang * @Description: * @Date: Created in 16:19 2019/1/9 */ @Configuration @EnableWebMvc public class Client1WebConfig implements WebMvcConfigurer { @Bean public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer(){ return new PropertySourcesPlaceholderConfigurer(); } @Override public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) { configurer.enable(); } @Override public void addViewControllers(ViewControllerRegistry registry) { registry.addViewController("/") .setViewName("forward:/index"); registry.addViewController("index"); registry.addViewController("/securedPage"); } @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/resources/**") .addResourceLocations("resources/"); } }