當前位置: 首頁>>代碼示例>>Java>>正文


Java DispatcherFilter類代碼示例

本文整理匯總了Java中org.springframework.boot.devtools.remote.server.DispatcherFilter的典型用法代碼示例。如果您正苦於以下問題:Java DispatcherFilter類的具體用法?Java DispatcherFilter怎麽用?Java DispatcherFilter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DispatcherFilter類屬於org.springframework.boot.devtools.remote.server包,在下文中一共展示了DispatcherFilter類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: remoteDevToolsDispatcherFilter

import org.springframework.boot.devtools.remote.server.DispatcherFilter; //導入依賴的package包/類
@Bean
@ConditionalOnMissingBean
public DispatcherFilter remoteDevToolsDispatcherFilter(AccessManager accessManager,
		Collection<HandlerMapper> mappers) {
	Dispatcher dispatcher = new Dispatcher(accessManager, mappers);
	return new DispatcherFilter(dispatcher);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:8,代碼來源:RemoteDevToolsAutoConfiguration.java

示例2: filter

import org.springframework.boot.devtools.remote.server.DispatcherFilter; //導入依賴的package包/類
@Bean
public DispatcherFilter filter() {
	PortProvider port = new StaticPortProvider(this.httpServerPort);
	TargetServerConnection connection = new SocketTargetServerConnection(port);
	HttpTunnelServer server = new HttpTunnelServer(connection);
	HandlerMapper mapper = new UrlHandlerMapper("/httptunnel",
			new HttpTunnelServerHandler(server));
	Collection<HandlerMapper> mappers = Collections.singleton(mapper);
	Dispatcher dispatcher = new Dispatcher(AccessManager.PERMIT_ALL, mappers);
	return new DispatcherFilter(dispatcher);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:12,代碼來源:HttpTunnelIntegrationTests.java

示例3: ignoresUnmappedUrl

import org.springframework.boot.devtools.remote.server.DispatcherFilter; //導入依賴的package包/類
@Test
public void ignoresUnmappedUrl() throws Exception {
	loadContext("spring.devtools.remote.secret:supersecret");
	DispatcherFilter filter = this.context.getBean(DispatcherFilter.class);
	this.request.setRequestURI("/restart");
	this.request.addHeader(DEFAULT_SECRET_HEADER_NAME, "supersecret");
	filter.doFilter(this.request, this.response, this.chain);
	assertRestartInvoked(false);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:10,代碼來源:RemoteDevToolsAutoConfigurationTests.java

示例4: ignoresIfMissingSecretFromRequest

import org.springframework.boot.devtools.remote.server.DispatcherFilter; //導入依賴的package包/類
@Test
public void ignoresIfMissingSecretFromRequest() throws Exception {
	loadContext("spring.devtools.remote.secret:supersecret");
	DispatcherFilter filter = this.context.getBean(DispatcherFilter.class);
	this.request.setRequestURI(DEFAULT_CONTEXT_PATH + "/restart");
	filter.doFilter(this.request, this.response, this.chain);
	assertRestartInvoked(false);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:9,代碼來源:RemoteDevToolsAutoConfigurationTests.java

示例5: ignoresInvalidSecretInRequest

import org.springframework.boot.devtools.remote.server.DispatcherFilter; //導入依賴的package包/類
@Test
public void ignoresInvalidSecretInRequest() throws Exception {
	loadContext("spring.devtools.remote.secret:supersecret");
	DispatcherFilter filter = this.context.getBean(DispatcherFilter.class);
	this.request.setRequestURI(DEFAULT_CONTEXT_PATH + "/restart");
	this.request.addHeader(DEFAULT_SECRET_HEADER_NAME, "invalid");
	filter.doFilter(this.request, this.response, this.chain);
	assertRestartInvoked(false);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:10,代碼來源:RemoteDevToolsAutoConfigurationTests.java

示例6: invokeRestartWithDefaultSetup

import org.springframework.boot.devtools.remote.server.DispatcherFilter; //導入依賴的package包/類
@Test
public void invokeRestartWithDefaultSetup() throws Exception {
	loadContext("spring.devtools.remote.secret:supersecret");
	DispatcherFilter filter = this.context.getBean(DispatcherFilter.class);
	this.request.setRequestURI(DEFAULT_CONTEXT_PATH + "/restart");
	this.request.addHeader(DEFAULT_SECRET_HEADER_NAME, "supersecret");
	filter.doFilter(this.request, this.response, this.chain);
	assertRestartInvoked(true);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:10,代碼來源:RemoteDevToolsAutoConfigurationTests.java

示例7: invokeRestartWithCustomServerContextPath

import org.springframework.boot.devtools.remote.server.DispatcherFilter; //導入依賴的package包/類
@Test
public void invokeRestartWithCustomServerContextPath() throws Exception {
	loadContext("spring.devtools.remote.secret:supersecret",
			"server.context-path:/test");
	DispatcherFilter filter = this.context.getBean(DispatcherFilter.class);
	this.request.setRequestURI("/test" + DEFAULT_CONTEXT_PATH + "/restart");
	this.request.addHeader(DEFAULT_SECRET_HEADER_NAME, "supersecret");
	filter.doFilter(this.request, this.response, this.chain);
	assertRestartInvoked(true);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:11,代碼來源:RemoteDevToolsAutoConfigurationTests.java

示例8: invokeTunnelWithDefaultSetup

import org.springframework.boot.devtools.remote.server.DispatcherFilter; //導入依賴的package包/類
@Test
public void invokeTunnelWithDefaultSetup() throws Exception {
	loadContext("spring.devtools.remote.secret:supersecret");
	DispatcherFilter filter = this.context.getBean(DispatcherFilter.class);
	this.request.setRequestURI(DEFAULT_CONTEXT_PATH + "/debug");
	this.request.addHeader(DEFAULT_SECRET_HEADER_NAME, "supersecret");
	filter.doFilter(this.request, this.response, this.chain);
	assertTunnelInvoked(true);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:10,代碼來源:RemoteDevToolsAutoConfigurationTests.java

示例9: invokeTunnelWithCustomServerContextPath

import org.springframework.boot.devtools.remote.server.DispatcherFilter; //導入依賴的package包/類
@Test
public void invokeTunnelWithCustomServerContextPath() throws Exception {
	loadContext("spring.devtools.remote.secret:supersecret",
			"server.context-path:/test");
	DispatcherFilter filter = this.context.getBean(DispatcherFilter.class);
	this.request.setRequestURI("/test" + DEFAULT_CONTEXT_PATH + "/debug");
	this.request.addHeader(DEFAULT_SECRET_HEADER_NAME, "supersecret");
	filter.doFilter(this.request, this.response, this.chain);
	assertTunnelInvoked(true);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:11,代碼來源:RemoteDevToolsAutoConfigurationTests.java

示例10: invokeTunnelWithCustomHeaderName

import org.springframework.boot.devtools.remote.server.DispatcherFilter; //導入依賴的package包/類
@Test
public void invokeTunnelWithCustomHeaderName() throws Exception {
	loadContext("spring.devtools.remote.secret:supersecret",
			"spring.devtools.remote.secretHeaderName:customheader");
	DispatcherFilter filter = this.context.getBean(DispatcherFilter.class);
	this.request.setRequestURI(DEFAULT_CONTEXT_PATH + "/debug");
	this.request.addHeader("customheader", "supersecret");
	filter.doFilter(this.request, this.response, this.chain);
	assertTunnelInvoked(true);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:11,代碼來源:RemoteDevToolsAutoConfigurationTests.java

示例11: devToolsHealthReturns200

import org.springframework.boot.devtools.remote.server.DispatcherFilter; //導入依賴的package包/類
@Test
public void devToolsHealthReturns200() throws Exception {
	loadContext("spring.devtools.remote.secret:supersecret");
	DispatcherFilter filter = this.context.getBean(DispatcherFilter.class);
	this.request.setRequestURI(DEFAULT_CONTEXT_PATH);
	this.request.addHeader(DEFAULT_SECRET_HEADER_NAME, "supersecret");
	this.response.setStatus(500);
	filter.doFilter(this.request, this.response, this.chain);
	assertThat(this.response.getStatus()).isEqualTo(200);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:11,代碼來源:RemoteDevToolsAutoConfigurationTests.java

示例12: devToolsHealthWithCustomServerContextPathReturns200

import org.springframework.boot.devtools.remote.server.DispatcherFilter; //導入依賴的package包/類
@Test
public void devToolsHealthWithCustomServerContextPathReturns200() throws Exception {
	loadContext("spring.devtools.remote.secret:supersecret",
			"server.context-path:/test");
	DispatcherFilter filter = this.context.getBean(DispatcherFilter.class);
	this.request.setRequestURI("/test" + DEFAULT_CONTEXT_PATH);
	this.request.addHeader(DEFAULT_SECRET_HEADER_NAME, "supersecret");
	this.response.setStatus(500);
	filter.doFilter(this.request, this.response, this.chain);
	assertThat(this.response.getStatus()).isEqualTo(200);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:12,代碼來源:RemoteDevToolsAutoConfigurationTests.java

示例13: devToolsHealthReturns200

import org.springframework.boot.devtools.remote.server.DispatcherFilter; //導入依賴的package包/類
@Test
public void devToolsHealthReturns200() throws Exception {
	loadContext("spring.devtools.remote.secret:supersecret");
	DispatcherFilter filter = this.context.getBean(DispatcherFilter.class);
	this.request.setRequestURI(DEFAULT_CONTEXT_PATH);
	this.request.addHeader(DEFAULT_SECRET_HEADER_NAME, "supersecret");
	this.response.setStatus(500);
	filter.doFilter(this.request, this.response, this.chain);
	assertThat(this.response.getStatus(), equalTo(200));
}
 
開發者ID:Nephilim84,項目名稱:contestparser,代碼行數:11,代碼來源:RemoteDevToolsAutoConfigurationTests.java

示例14: disabledIfRemoteSecretIsMissing

import org.springframework.boot.devtools.remote.server.DispatcherFilter; //導入依賴的package包/類
@Test
public void disabledIfRemoteSecretIsMissing() throws Exception {
	loadContext("a:b");
	this.thrown.expect(NoSuchBeanDefinitionException.class);
	this.context.getBean(DispatcherFilter.class);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:7,代碼來源:RemoteDevToolsAutoConfigurationTests.java

示例15: dispatcherFilter

import org.springframework.boot.devtools.remote.server.DispatcherFilter; //導入依賴的package包/類
@Bean
public DispatcherFilter dispatcherFilter() throws IOException {
	return new DispatcherFilter(dispatcher());
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:5,代碼來源:RemoteClientConfigurationTests.java


注:本文中的org.springframework.boot.devtools.remote.server.DispatcherFilter類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。