Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package io.undertow.servlet;
  
  
 
Utility class for building servlet deployments.

Author(s):
Stuart Douglas
 
 public class Servlets {
 
     private static volatile ServletContainer container;

    
Returns the default servlet container. For most embedded use cases this will be sufficient.

Returns:
The default servlet container
 
     public static ServletContainer defaultContainer() {
         if ( != null) {
             return ;
         }
         synchronized (Servlets.class) {
             if ( != null) {
                 return ;
             }
             return  = ServletContainer.Factory.newInstance();
         }
     }

    
Creates a new servlet container.

Returns:
A new servlet container
 
     public static ServletContainer newContainer() {
         return new ServletContainerImpl();
     }

    
Creates a new servlet deployment info structure

Returns:
A new deployment info structure
 
     public static DeploymentInfo deployment() {
         return new DeploymentInfo();
     }

    
Creates a new servlet description with the given name and class

Parameters:
name The servlet name
servletClass The servlet class
Returns:
A new servlet description
 
     public static ServletInfo servlet(final String namefinal Class<? extends ServletservletClass) {
         return new ServletInfo(nameservletClass);
     }

    
Creates a new servlet description with the given name and class

Parameters:
name The servlet name
servletClass The servlet class
Returns:
A new servlet description
 
     public static ServletInfo servlet(final String namefinal Class<? extends ServletservletClassfinal InstanceFactory<? extends Servletservlet) {
         return new ServletInfo(nameservletClassservlet);
     }


    
Creates a new servlet description with the given name and class

Parameters:
name The filter name
filterClass The filter class
Returns:
A new servlet description
 
     public static FilterInfo filter(final String namefinal Class<? extends FilterfilterClass) {
         return new FilterInfo(namefilterClass);
     }

    
Creates a new servlet description with the given name and class

Parameters:
name The filter name
filterClass The filter class
Returns:
A new filter description
    public static FilterInfo filter(final String namefinal Class<? extends FilterfilterClassfinal InstanceFactory<? extends Filterfilter) {
        return new FilterInfo(namefilterClassfilter);
    }

    
Creates a new multipart config element

Parameters:
location the directory location where files will be stored
maxFileSize the maximum size allowed for uploaded files
maxRequestSize the maximum size allowed for multipart/form-data requests
fileSizeThreshold the size threshold after which files will be written to disk
    public static MultipartConfigElement multipartConfig(String locationlong maxFileSizelong maxRequestSizeint fileSizeThreshold) {
        return new MultipartConfigElement(locationmaxFileSizemaxRequestSizefileSizeThreshold);
    }
    public static ListenerInfo listener(final Class<? extends EventListenerlistenerClassfinal InstanceFactory<? extends EventListenerinstanceFactory) {
        return new ListenerInfo(listenerClassinstanceFactory);
    }
    public static ListenerInfo listener(final Class<? extends EventListenerlistenerClass) {
        return new ListenerInfo(listenerClass);
    }
    public static SecurityConstraint securityConstraint() {
        return new SecurityConstraint();
    }
    public static WebResourceCollection webResourceCollection() {
        return new WebResourceCollection();
    }
    private Servlets() {
    }
    public static LoginConfig loginConfig(String realmNameString loginPageString errorPage) {
        return new LoginConfig(realmNameloginPageerrorPage);
    }
    public static LoginConfig loginConfig(final String realmName) {
        return new LoginConfig(realmName);
    }
    public static LoginConfig loginConfig(String mechanismNameString realmNameString loginPageString errorPage) {
        return new LoginConfig(mechanismNamerealmNameloginPageerrorPage);
    }
    public static LoginConfig loginConfig(String mechanismNamefinal String realmName) {
        return new LoginConfig(mechanismNamerealmName);
    }
New to GrepCode? Check out our FAQ X