当前位置:   article > 正文

Spring配置类WebMvcConfigurationSupport部分方法介绍_org.springframework.web.servlet.config.annotation.

org.springframework.web.servlet.config.annotation.webmvcconfigurationsupport

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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/576389
推荐阅读
相关标签
  

闽ICP备14008679号