public class Servlets extends Object
Modifier and Type | Method and Description |
---|---|
static ServletContainer | defaultContainer() Returns the default servlet container. |
static DeploymentInfo | deployment() Creates a new servlet deployment info structure |
static ErrorPage | errorPage(String location) Create an ErrorPage that corresponds to the default error page |
static ErrorPage | errorPage(String location, Class<? extends Throwable> exceptionType) Create an ErrorPage instance for a given exception type |
static ErrorPage | errorPage(String location, int statusCode) Create an ErrorPage instance for a given response code |
static FilterInfo | filter(Class<? extends javax.servlet.Filter> filterClass) Creates a new filter description with the given class. |
static FilterInfo | filter(String name, Class<? extends javax.servlet.Filter> filterClass) Creates a new filter description with the given name and class |
static FilterInfo | filter(String name, Class<? extends javax.servlet.Filter> filterClass, InstanceFactory<? extends javax.servlet.Filter> filter) Creates a new filter description with the given name and class |
static ListenerInfo | listener(Class<? extends EventListener> listenerClass) |
static ListenerInfo | listener(Class<? extends EventListener> listenerClass, InstanceFactory<? extends EventListener> instanceFactory) |
static LoginConfig | loginConfig(String realmName) |
static LoginConfig | loginConfig(String mechanismName, String realmName) |
static LoginConfig | loginConfig(String realmName, String loginPage, String errorPage) |
static LoginConfig | loginConfig(String mechanismName, String realmName, String loginPage, String errorPage) |
static javax.servlet.MultipartConfigElement | multipartConfig(String location, long maxFileSize, long maxRequestSize, int fileSizeThreshold) Creates a new multipart config element |
static ServletContainer | newContainer() Creates a new servlet container. |
static SecurityConstraint | securityConstraint() |
static ServletInfo | servlet(Class<? extends javax.servlet.Servlet> servletClass) Creates a new servlet description with the given class. |
static ServletInfo | servlet(String name, Class<? extends javax.servlet.Servlet> servletClass) Creates a new servlet description with the given name and class |
static ServletInfo | servlet(String name, Class<? extends javax.servlet.Servlet> servletClass, InstanceFactory<? extends javax.servlet.Servlet> servlet) Creates a new servlet description with the given name and class |
static WebResourceCollection | webResourceCollection() |
public static ServletContainer defaultContainer()
public static ServletContainer newContainer()
public static DeploymentInfo deployment()
public static ServletInfo servlet(Class<? extends javax.servlet.Servlet> servletClass)
servletClass
- The servlet classpublic static ServletInfo servlet(String name, Class<? extends javax.servlet.Servlet> servletClass)
name
- The servlet nameservletClass
- The servlet classpublic static ServletInfo servlet(String name, Class<? extends javax.servlet.Servlet> servletClass, InstanceFactory<? extends javax.servlet.Servlet> servlet)
name
- The servlet nameservletClass
- The servlet classpublic static FilterInfo filter(Class<? extends javax.servlet.Filter> filterClass)
filterClass
- The filter classpublic static FilterInfo filter(String name, Class<? extends javax.servlet.Filter> filterClass)
name
- The filter namefilterClass
- The filter classpublic static FilterInfo filter(String name, Class<? extends javax.servlet.Filter> filterClass, InstanceFactory<? extends javax.servlet.Filter> filter)
name
- The filter namefilterClass
- The filter classpublic static javax.servlet.MultipartConfigElement multipartConfig(String location, long maxFileSize, long maxRequestSize, int fileSizeThreshold)
location
- the directory location where files will be storedmaxFileSize
- the maximum size allowed for uploaded filesmaxRequestSize
- the maximum size allowed for multipart/form-data requestsfileSizeThreshold
- the size threshold after which files will be written to diskpublic static ListenerInfo listener(Class<? extends EventListener> listenerClass, InstanceFactory<? extends EventListener> instanceFactory)
public static ListenerInfo listener(Class<? extends EventListener> listenerClass)
public static SecurityConstraint securityConstraint()
public static WebResourceCollection webResourceCollection()
public static LoginConfig loginConfig(String realmName, String loginPage, String errorPage)
public static LoginConfig loginConfig(String realmName)
public static LoginConfig loginConfig(String mechanismName, String realmName, String loginPage, String errorPage)
public static LoginConfig loginConfig(String mechanismName, String realmName)
public static ErrorPage errorPage(String location, Class<? extends Throwable> exceptionType)
location
- The location to redirect toexceptionType
- The exception typepublic static ErrorPage errorPage(String location, int statusCode)
location
- The location to redirect tostatusCode
- The status codeCopyright © 2017 JBoss by Red Hat. All rights reserved.