本文整理了Java中io.undertow.servlet.Servlets.filter()
方法的一些代码示例,展示了Servlets.filter()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Servlets.filter()
方法的具体详情如下:
包路径:io.undertow.servlet.Servlets
类名称:Servlets
方法名:filter
[英]Creates a new filter description with the given class. The filter name is inferred from the simple name of the class.
[中]使用给定的类创建新的筛选器描述。过滤器名称是从类的简单名称推断出来的。
代码示例来源:origin: io.undertow/undertow-servlet
/**
* Creates a new filter description with the given class. The filter name is inferred from the simple name of the class.
*
* @param filterClass The filter class
* @return A new filter description
*/
public static FilterInfo filter(final Class<? extends Filter> filterClass) {
return filter(filterClass.getSimpleName(), filterClass);
}
代码示例来源:origin: com.redhat.lightblue.rest/lightblue-rest-integration-test
private void configureDeployment(DeploymentInfo deploymentInfo, String name, String contextPath) {
deploymentInfo.setClassLoader(getClass().getClassLoader());
deploymentInfo.setDeploymentName(name);
deploymentInfo.setContextPath(contextPath);
deploymentInfo.addFilter(Servlets.filter(name + "LoggingFilter", LoggingFilter.class));
deploymentInfo.addFilterUrlMapping(name + "LoggingFilter", "/*", DispatcherType.REQUEST);
}
代码示例来源:origin: org.projectodd.wunderboss/wunderboss-web-undertow
final String filterName = entry.getKey() + servletName;
final Filter filter = entry.getValue();
FilterInfo filterInfo = Servlets.filter(filterName, filter.getClass(),
new ImmediateInstanceFactory<>(filter));
filterInfo.setAsyncSupported(true);
代码示例来源:origin: ws.ament.hammock/web-undertow
servlets.forEach(di::addServlet);
getFilterDescriptors().forEach(filterDescriptor -> {
FilterInfo filterInfo = filter(filterDescriptor.displayName(), filterDescriptor.getClazz()).setAsyncSupported(filterDescriptor.asyncSupported());
if(filterDescriptor.initParams() != null) {
for (WebInitParam param : filterDescriptor.initParams()) {
代码示例来源:origin: hammock-project/hammock
servlets.forEach(di::addServlet);
getFilterDescriptors().forEach(filterDescriptor -> {
FilterInfo filterInfo = filter(filterDescriptor.displayName(), filterDescriptor.getClazz()).setAsyncSupported(filterDescriptor.asyncSupported());
if(filterDescriptor.initParams() != null) {
for (WebInitParam param : filterDescriptor.initParams()) {
代码示例来源:origin: org.commonjava.indy/indy-subsys-jaxrs
Servlets.filter( "Naming and Resource Management", ResourceManagementFilter.class,
new ImmediateInstanceFactory<ResourceManagementFilter>(
this.resourceManagementFilter ) );
final FilterInfo apiVersioningFilter =
Servlets.filter( "ApiVersioning", ApiVersioningFilter.class,
new ImmediateInstanceFactory<ApiVersioningFilter>(
this.apiVersioningFilter ) );
代码示例来源:origin: yangfuhai/jboot
deploymentInfo.addListeners(Servlets.listener(EnvironmentLoaderListener.class));
deploymentInfo.addFilter(
Servlets.filter("shiro", JbootShiroFilter.class))
.addFilterUrlMapping("shiro", shiroConfig.getUrlMapping(), DispatcherType.REQUEST);
Servlets.filter("jfinal", JFinalFilter.class)
.addInitParam("configClass", Jboot.me().getJbootConfig().getJfinalConfig()))
.addFilterUrlMapping("jfinal", "/*", DispatcherType.REQUEST);
内容来源于网络,如有侵权,请联系作者删除!