当前位置: 首页>>代码示例>>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;未经允许,请勿转载。