首页>代码>基于Springboot Security开发的Github第三方登录Demo实例>/SpringbootSecurity/src/main/java/com/security/config/MVCConfig.java
package com.security.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * 
 * @Description:MVC配置
 * @author [ Wenfeng.Huang@desay-svautomotive.com ] on [2018年9月5日上午9:54:47]
 * @Modified By: [修改人] on [修改日期] for [修改说明]
 *
 */
@Configuration
public class MVCConfig extends WebMvcConfigurerAdapter {
	
	/**
	 * 页面跳转请求注册
	 */
	@Override
	public void addViewControllers(ViewControllerRegistry registry) {
		//默认页面
		registry.addViewController("/").setViewName("forward:/login");
		//登录页面url
		registry.addViewController("/login").setViewName("login");
		//登录成功之后跳转的页面,如果需要传入一些资源参数进页面可以写到controller里
		//registry.addViewController("/main").setViewName("main");
	}
	
	/**
	 * 静态资源配置
	 */
	@Override
	  public void addResourceHandlers(ResourceHandlerRegistry registry) {   
		  registry.addResourceHandler("/static/**").addResourceLocations("/static/");
	      super.addResourceHandlers(registry);
	  }
}
最近下载更多
ゆ 、 Hurt°  LV2 2022年8月30日
呵呵哈哈哈  LV10 2022年7月8日
liuchenxi  LV1 2022年1月15日
lyws1986  LV17 2021年12月9日
fenghuijun  LV26 2021年8月23日
ericxu1116  LV24 2021年7月1日
shiopaaa  LV13 2021年4月15日
newhaijun  LV15 2021年3月29日
Coincidance  LV8 2020年12月3日
aa991215  LV17 2020年9月2日
最近浏览更多
ysugxx  LV9 2023年12月9日
chenlie  LV2 2023年11月8日
漫步的海星  LV4 2023年9月26日
linkage  LV1 2023年7月17日
skook7  LV2 2023年6月1日
hjjhhhh  LV4 2023年4月13日
做你的景天  LV7 2023年3月31日
东北虎啸  LV3 2022年12月29日
Xiaomoa 2022年12月14日
暂无贡献等级
xingbing  LV9 2022年12月9日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友