本文整理汇总了Java中io.undertow.servlet.ServletExtension类的典型用法代码示例。如果您正苦于以下问题:Java ServletExtension类的具体用法?Java ServletExtension怎么用?Java ServletExtension使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ServletExtension类属于io.undertow.servlet包,在下文中一共展示了ServletExtension类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addFaviconExceptionHandler
import io.undertow.servlet.ServletExtension; //导入依赖的package包/类
/**
* Add the default WildFly Swarm {@code favicon.ico} handler.
*
* @return This archive.
*/
@SuppressWarnings("unchecked")
default T addFaviconExceptionHandler() throws IOException {
// Add FaviconServletExtension
String path = "WEB-INF/classes/" + FaviconServletExtension.EXTENSION_NAME.replace('.', '/') + ".class";
byte[] generatedExtension;
generatedExtension = FaviconFactory.createFaviconServletExtension(FaviconServletExtension.EXTENSION_NAME);
add(new ByteArrayAsset(generatedExtension), path);
// Add FaviconErrorHandler
path = "WEB-INF/classes/" + FaviconServletExtension.HANDLER_NAME.replace('.', '/') + ".class";
byte[] generatedHandler;
generatedHandler = FaviconFactory.createFaviconErrorHandler(FaviconServletExtension.HANDLER_NAME);
add(new ByteArrayAsset(generatedHandler), path);
// Add services entry for FaviconServletExtension
this.addAsServiceProvider(ServletExtension.class.getName(), FaviconServletExtension.EXTENSION_NAME);
return (T) this;
}
示例2: getServletExtensions
import io.undertow.servlet.ServletExtension; //导入依赖的package包/类
public List<ServletExtension> getServletExtensions() {
return servletExtensions;
}
示例3: addServletExtension
import io.undertow.servlet.ServletExtension; //导入依赖的package包/类
/**
* Adds an additional servlet extension to the deployment. Servlet extensions are generally discovered
* using META-INF/services entries, however this may not be practical in all environments.
* @param servletExtension The servlet extension
* @return this
*/
public DeploymentInfo addServletExtension(final ServletExtension servletExtension) {
this.servletExtensions.add(servletExtension);
return this;
}