當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。