Interface WebApplication

All Superinterfaces:
ServletContext
All Known Implementing Classes:
DefaultWebApplication

public interface WebApplication
extends ServletContext
The WebApplication API.
Author:
Manfred Riem ([email protected])
  • Method Details

    • addErrorPage

      void addErrorPage​(int code, java.lang.String location)
      Adds an error page to be forwarded to on the given HTTP status code
      Parameters:
      code - the HTTP code for which the error page is to be invoked
      location - the location of the error page
    • addErrorPage

      void addErrorPage​(java.lang.String exception, java.lang.String location)
      Adds an error page to be forwarded to on the given exception
      Parameters:
      exception - the exception for which the error page is to be invoked
      location - the location of the error page
    • addFilterMapping

      default java.util.Set<java.lang.String> addFilterMapping​(java.lang.String filterName, java.lang.String... urlPatterns)
      Add a mapping for the given filter.
      Parameters:
      filterName - the filter name.
      urlPatterns - the URL patterns.
      Returns:
      the possible empty set of already mapped URL patterns.
      See Also:
      FilterRegistration.addMappingForUrlPatterns(EnumSet, boolean, String...)
    • addFilterMapping

      default java.util.Set<java.lang.String> addFilterMapping​(java.lang.String filterName, boolean isMatchAfter, java.lang.String... urlPatterns)
      Add a mapping for the given filter.
      Parameters:
      filterName - the filter name.
      isMatchAfter - true to call the filter this mapping applies to after declared ones, false to call it before declared ones.
      urlPatterns - the URL patterns.
      Returns:
      the possible empty set of already mapped URL patterns.
      See Also:
      FilterRegistration.addMappingForUrlPatterns(EnumSet, boolean, String...)
    • addFilterMapping

      java.util.Set<java.lang.String> addFilterMapping​(java.util.Set<DispatcherType> dispatcherTypes, java.lang.String filterName, boolean isMatchAfter, java.lang.String... urlPatterns)
      Add a mapping for the given filter.
      Parameters:
      dispatcherTypes - the dispatcher types. Can be null to use default DispatcherType.REQUEST.
      filterName - the filter name.
      isMatchAfter - true to call the filter this mapping applies to after declared ones, false to call it before declared ones.
      urlPatterns - the URL patterns.
      Returns:
      the possible empty set of already mapped URL patterns.
      See Also:
      FilterRegistration.addMappingForUrlPatterns(EnumSet, boolean, String...)
    • addInitializer

      void addInitializer​(java.lang.String className)
      Add a servlet container initializer.
      Parameters:
      className - the class name.
    • addInitializer

      void addInitializer​(ServletContainerInitializer servletContainerInitializer)
      Add a servlet container initializer.
      Parameters:
      servletContainerInitializer - the servletContainerInitializer instance
    • addResource

      void addResource​(Resource resource)
      Add the resource.
      Parameters:
      resource - the resouce.
    • addServletMapping

      java.util.Set<java.lang.String> addServletMapping​(java.lang.String servletName, java.lang.String... urlPatterns)
      Add a mapping for the given servlet.
      Parameters:
      servletName - the servlet name.
      urlPatterns - the URL patterns.
      Returns:
      the possible empty set of already mapped URL patterns.
      See Also:
      ServletRegistration.addMapping(String...)
    • destroy

      void destroy()
      Destroy the web application.
    • getAnnotationManager

      AnnotationManager getAnnotationManager()
      Gets the annotation manager.
      Returns:
      the annotation manager.
    • getAsyncManager

      AsyncManager getAsyncManager()
      Get the async manager.
      Returns:
      the async manager.
    • getDefaultServlet

      Servlet getDefaultServlet()
      Get the default Servlet.
      Returns:
      the default Servlet.
    • getDenyUncoveredHttpMethods

      boolean getDenyUncoveredHttpMethods()
      Are we denying uncovered HTTP methods.
      Returns:
      true if we are, false otherwise.
    • getMimeTypeManager

      MimeTypeManager getMimeTypeManager()
      Get the mime type manager.
      Returns:
      the mime type manager.
    • getMultiPartManager

      MultiPartManager getMultiPartManager()
      Get the multi part manager.
      Returns:
      the multi part manager.
    • getServletContextId

      default java.lang.String getServletContextId()
      Returns the unique Id of this web application corresponding to this ServletContext.
      Returns:
      the servlet context id.
    • getHttpSessionManager

      HttpSessionManager getHttpSessionManager()
      Get the HttpSessionManager.
      Returns:
      the HttpSessionManager.
    • getHttpRequestManager

      HttpRequestManager getHttpRequestManager()
      Get the HttpRequestManager.
      Returns:
      the HttpRequestManager.
    • getInitializers

      java.util.List<ServletContainerInitializer> getInitializers()
      Gets the ServletContainerInitializers
      Returns:
      list of ServletContainerInitializers
    • getMappings

      java.util.Collection<java.lang.String> getMappings​(java.lang.String servletName)
      Get the mappings for a particular servlet.
      Parameters:
      servletName - the servlet name.
      Returns:
      the possible empty set of mapped URL patterns.
      See Also:
      ServletRegistration.getMappings()
    • getObjectInstanceManager

      ObjectInstanceManager getObjectInstanceManager()
      Get the object instance manager.
      Returns:
      the DependencyInjectionManager.
    • getRequest

      ServletRequest getRequest​(ServletResponse response)
      Get the associated request.
      Parameters:
      response - the response.
      Returns:
      the associated request.
    • getResponse

      ServletResponse getResponse​(ServletRequest request)
      Get the associated response.
      Parameters:
      request - the request.
      Returns:
      the associated response.
    • getSecurityManager

      SecurityManager getSecurityManager()
      Get the security manager.
      Returns:
      the security manager.
    • getWelcomeFileManager

      WelcomeFileManager getWelcomeFileManager()
      Get the welcome file manager.
      Returns:
      the welcome file manager.
    • initialize

      void initialize()
      Initialize the web application.
    • initializeDeclaredFinish

      void initializeDeclaredFinish()
      Marks the end of initializing declared (web.xml, annotations) artifacts
    • initializeFinish

      void initializeFinish()
      Finish the initialization.
    • initializeFilters

      void initializeFilters()
      Initialize the filters.
    • initializeInitializers

      void initializeInitializers()
      Initialize the servlet container initializers.
    • initializeServlets

      void initializeServlets()
      Initialize the servlets.
    • isDistributable

      boolean isDistributable()
      Is the application distributable.
      Returns:
      true if it is, false otherwise.
    • linkRequestAndResponse

      void linkRequestAndResponse​(ServletRequest request, ServletResponse response)
      Link the request and response.
      Parameters:
      request - the request.
      response - the response.
    • service

      void service​(ServletRequest request, ServletResponse response) throws ServletException, java.io.IOException
      Service the request.
      Parameters:
      request - the request.
      response - the response.
      Throws:
      ServletException - when a servlet error occurs.
      java.io.IOException - when an I/O error occurs.
    • setClassLoader

      void setClassLoader​(java.lang.ClassLoader classLoader)
      Set the class loader.
      Parameters:
      classLoader - the class loader.
    • setContextPath

      void setContextPath​(java.lang.String contextPath)
      Set the context path.
      Parameters:
      contextPath - the context path.
    • setDefaultServlet

      void setDefaultServlet​(Servlet defaultServlet)
      Set the default servlet.
      Parameters:
      defaultServlet - the default servlet.
    • setDenyUncoveredHttpMethods

      void setDenyUncoveredHttpMethods​(boolean denyUncoveredHttpMethods)
      Set if we are denying uncovered HTTP methods.
      Parameters:
      denyUncoveredHttpMethods - the boolean value.
    • setDistributable

      void setDistributable​(boolean distributable)
      Set if the web application is distributable.
      Parameters:
      distributable - the distributable flag.
    • setEffectiveMajorVersion

      void setEffectiveMajorVersion​(int version)
      Set the effective major version.
    • setEffectiveMinorVersion

      void setEffectiveMinorVersion​(int version)
      Set the effective minor version.
    • setHttpSessionManager

      void setHttpSessionManager​(HttpSessionManager httpSessionManager)
      Set the HTTP session manager.
      Parameters:
      httpSessionManager - the HTTP session manager.
    • setHttpRequestManager

      void setHttpRequestManager​(HttpRequestManager httpRequestManager)
      Set the HTTP request manager.
      Parameters:
      httpRequestManager - the HTTP request manager.
    • setJspManager

      void setJspManager​(JspManager jspManager)
      Set the JSP manager.
      Parameters:
      jspManager - the JSP manager.
    • setLoggingManager

      void setLoggingManager​(LoggingManager loggingManager)
      Set the logging manager.
      Parameters:
      loggingManager - the logging manager.
    • setMimeTypeManager

      void setMimeTypeManager​(MimeTypeManager mimeTypeManager)
      Set the mimeType manager.
      Parameters:
      mimeTypeManager - the mimeType manager.
    • setMultiPartManager

      void setMultiPartManager​(MultiPartManager multiPartManager)
      Set the multi part manager.
      Parameters:
      multiPartManager - the multi part manager.
    • setObjectInstanceManager

      void setObjectInstanceManager​(ObjectInstanceManager objectInstanceManager)
      Set the object instance manager.
      Parameters:
      objectInstanceManager - the object instance manager.
    • setResourceManager

      void setResourceManager​(ResourceManager resourceManager)
      Set the resource manager.
      Parameters:
      resourceManager - the resource manager.
    • setSecurityManager

      void setSecurityManager​(SecurityManager securityManager)
      Set the security manager.
      Parameters:
      securityManager - the security manager.
    • setAnnotationManager

      void setAnnotationManager​(AnnotationManager annotationManager)
      Sets the annotation manager.
      Parameters:
      annotationManager - the annotation manager
    • setServletContextName

      void setServletContextName​(java.lang.String servletContextName)
      Set the servlet context name.
      Parameters:
      servletContextName - the servlet context name.
    • setWebApplicationRequestMapper

      void setWebApplicationRequestMapper​(WebApplicationRequestMapper webApplicationRequestMapper)
      Set the web application request mapper.
      Parameters:
      webApplicationRequestMapper - the web application request mapper.
    • setWelcomeFileManager

      void setWelcomeFileManager​(WelcomeFileManager welcomeFileManager)
      Set the welcome file manager.
      Parameters:
      welcomeFileManager - the welcome file manager.
    • start

      void start()
      Start servicing.
    • stop

      void stop()
      Stop servicing.
    • unlinkRequestAndResponse

      void unlinkRequestAndResponse​(ServletRequest request, ServletResponse response)
      Unlink the request and response.
      Parameters:
      request - the request.
      response - the response.