赞
踩
package com.cowcow;
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.WebMvcConfigurationSupport;
@Configuration
public class DemoConfiguration extends WebMvcConfigurationSupport{
@Override
protected void addViewControllers(ViewControllerRegistry registry) {
// TODO Auto-generated method stub
//若无业务逻辑处理,直接请求页面可以再次设置请求资源
registry.addViewController("/").setViewName("index");
registry.addViewController("/index").setViewName("index");
super.addViewControllers(registry);
}
@Override
protected void addResourceHandlers(ResourceHandle
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。