当前位置: 首页>>代码示例>>Java>>正文


Java ViewControllerRegistry类代码示例

本文整理汇总了Java中org.springframework.web.servlet.config.annotation.ViewControllerRegistry的典型用法代码示例。如果您正苦于以下问题:Java ViewControllerRegistry类的具体用法?Java ViewControllerRegistry怎么用?Java ViewControllerRegistry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ViewControllerRegistry类属于org.springframework.web.servlet.config.annotation包,在下文中一共展示了ViewControllerRegistry类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: webMvcConfigurer

import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; //导入依赖的package包/类
@Bean
public WebMvcConfigurer webMvcConfigurer() {
    return new WebMvcConfigurerAdapter() {
        @Override
        public void addViewControllers(ViewControllerRegistry viewControllerRegistry) {

            // 首页默认加载web端
            viewControllerRegistry.addViewController("/").setViewName("/web/index.html");
            viewControllerRegistry.addViewController("/index.html").setViewName("redirect:/");

            // web首页
            viewControllerRegistry.addViewController("/web").setViewName("/web/index.html");

            // webapp首页
            viewControllerRegistry.addViewController("/webapp").setViewName("/webapp/index.html");

            viewControllerRegistry.setOrder(Ordered.HIGHEST_PRECEDENCE);
            super.addViewControllers(viewControllerRegistry);
        }
    };
}
 
开发者ID:stephenml,项目名称:basic,代码行数:22,代码来源:Application.java

示例2: addViewControllers

import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; //导入依赖的package包/类
@Override
public void addViewControllers(ViewControllerRegistry registry) {
	super.addViewControllers(registry);

    registry.addRedirectViewController("/", "/ui");

    registry.addViewController("/ui/**").setViewName("forward:/index.html");
}
 
开发者ID:gilles-stragier,项目名称:quickmon,代码行数:9,代码来源:WebMvcConfig.java

示例3: addViewControllers

import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; //导入依赖的package包/类
@Override
public void addViewControllers(final ViewControllerRegistry registry) {
    super.addViewControllers(registry);

    registry.addViewController("/login/form")
            .setViewName("login");
    registry.addViewController("/errors/403")
            .setViewName("/errors/403");

    registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
}
 
开发者ID:PacktPublishing,项目名称:Spring-Security-Third-Edition,代码行数:12,代码来源:WebMvcConfig.java

示例4: addViewControllers

import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; //导入依赖的package包/类
@Override
public void addViewControllers(ViewControllerRegistry registry) {
	registry.addViewController( "/" ).setViewName("index");
       registry.setOrder(Ordered.HIGHEST_PRECEDENCE );
       
       registry.addViewController( "/edit" ).setViewName("edit");
       registry.addViewController( "/upload" ).setViewName("upload");
	super.addViewControllers(registry);
}
 
开发者ID:ekoz,项目名称:kbase-doc,代码行数:10,代码来源:WebMvcConfigurer.java

示例5: addViewControllers

import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; //导入依赖的package包/类
/**
 * 配置默认路径为文档
 * @param registry
 */
@Override
public void addViewControllers( ViewControllerRegistry registry ) {
    registry.addViewController( "" ).setViewName( "redirect:/swagger-ui.html" );
    registry.setOrder( Ordered.HIGHEST_PRECEDENCE );
    super.addViewControllers( registry );
}
 
开发者ID:ChinaLHR,项目名称:JavaQuarkBBS,代码行数:11,代码来源:MyAdapter.java

示例6: forwardToIndex

import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; //导入依赖的package包/类
@Bean
public WebMvcConfigurerAdapter forwardToIndex() {
    return new WebMvcConfigurerAdapter() {
        @Override
        public void addViewControllers(ViewControllerRegistry registry) {
            // forward requests to /admin and /user to their index.html
            registry.addViewController("/**").setViewName(
                    "forward:/index.html");
        }
    };
}
 
开发者ID:monPlan,项目名称:springboot-spwa-gae-demo,代码行数:12,代码来源:WebConfig.java

示例7: addViewControllers

import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; //导入依赖的package包/类
@Override
public void addViewControllers(ViewControllerRegistry registry) {
	registry.addViewController("/viewUsers").setViewName("viewUsers");
	registry.addViewController("/index").setViewName("index");
	registry.addViewController("/").setViewName("index");
	registry.addViewController("/login").setViewName("login");
}
 
开发者ID:gauravrmazra,项目名称:gauravbytes,代码行数:8,代码来源:MvcConfig.java

示例8: addViewControllers

import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; //导入依赖的package包/类
@Override
public void addViewControllers(ViewControllerRegistry registry) {
	registry.addViewController("/index").setViewName("/index");
	registry.addViewController("/toUpload").setViewName("/upload");
	registry.addViewController("/converter").setViewName("/converter");
	registry.addViewController("/sse").setViewName("/sse");
}
 
开发者ID:longjiazuo,项目名称:springMvc4.x-project,代码行数:8,代码来源:MyMvcConfig.java

示例9: addViewControllers

import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; //导入依赖的package包/类
@Override
public void addViewControllers(ViewControllerRegistry registry) {
	registry.addViewController("/index").setViewName("/index");
	registry.addViewController("/toUpload").setViewName("/upload");
	registry.addViewController("/converter").setViewName("/converter");
	registry.addViewController("/sse").setViewName("/sse");
	registry.addViewController("/async").setViewName("/async");
}
 
开发者ID:longjiazuo,项目名称:springMvc4.x-project,代码行数:9,代码来源:MyMvcConfig.java

示例10: webMvcConfigurerAdapter

import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; //导入依赖的package包/类
@Bean
public WebMvcConfigurerAdapter webMvcConfigurerAdapter() {
    return new WebMvcConfigurerAdapter() {
        @Override
        public void addViewControllers(ViewControllerRegistry registry) {
            registry.addViewController("/")
                .setStatusCode(HttpStatus.PERMANENT_REDIRECT)
                .setViewName("/swagger-ui.html");
        }
    };
}
 
开发者ID:groovylabs,项目名称:lyre,代码行数:12,代码来源:Lyre.java

示例11: addViewControllers

import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; //导入依赖的package包/类
@Override
public void addViewControllers(ViewControllerRegistry registry) {
	registry.addViewController("/").setViewName("home");
	registry.addViewController("/home").setViewName("home");
	registry.addViewController("/login").setViewName("login");
	registry.addViewController("/oauth/confirm_access").setViewName("authorize");
}
 
开发者ID:JerryNiu,项目名称:cloud,代码行数:8,代码来源:MvcConfig.java

示例12: addViewControllers

import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; //导入依赖的package包/类
@Override
public void addViewControllers(final ViewControllerRegistry registry) {
    registry.addViewController("/ui").setViewName("redirect:ui/");
    registry.addViewController("/ui/").setViewName("forward:index.html");
    registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
    super.addViewControllers(registry);
}
 
开发者ID:anthonyraymond,项目名称:joal,代码行数:8,代码来源:WebMvcConfiguration.java

示例13: forwardToIndex

import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; //导入依赖的package包/类
@Bean
public WebMvcConfigurerAdapter forwardToIndex() {
    return new WebMvcConfigurerAdapter() {
        @Override
        public void addViewControllers(ViewControllerRegistry registry) {
            // forward requests index.htm (as we might have two spring boot tomcats running in the same JVM they can see each others resources
            // so we use different index files to avoid confusion
            registry.addViewController("/").setViewName(
                    "forward:/monitor.html");
        }
    };
}
 
开发者ID:flowing,项目名称:flowing-retail,代码行数:13,代码来源:TomcatConfiguration.java


注:本文中的org.springframework.web.servlet.config.annotation.ViewControllerRegistry类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。