ApplicationServletRegistration (Apache Tomcat 8.5.87 API Documentation)

Package org.apache.catalina.core

## Class ApplicationServletRegistration

- java.lang.Object
- - org.apache.catalina.core.ApplicationServletRegistration

- All Implemented Interfaces:
    `Registration`, `Registration.Dynamic`, `ServletRegistration`, `ServletRegistration.Dynamic`

      public class ApplicationServletRegistration
      extends java.lang.Object
      implements ServletRegistration.Dynamic

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface javax.servlet.Registration

      `Registration.Dynamic`

    - ### Nested classes/interfaces inherited from interface javax.servlet.ServletRegistration

      `ServletRegistration.Dynamic`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ApplicationServletRegistration​(Wrapper wrapper, Context context)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.util.Set<java.lang.String>` | `addMapping​(java.lang.String... urlPatterns)` | Adds a servlet mapping with the given URL patterns for the Servlet represented by this ServletRegistration.
    `java.lang.String` | `getClassName()` | Obtain the name of the implementation class for the Servlet.
    `java.lang.String` | `getInitParameter​(java.lang.String name)` | Get the value of an initialisation parameter.
    `java.util.Map<java.lang.String,​java.lang.String>` | `getInitParameters()` | Get the names and values of all the initialisation parameters.
    `java.util.Collection<java.lang.String>` | `getMappings()` | Gets the currently available mappings of the Servlet represented by this ServletRegistration.
    `java.lang.String` | `getName()` | Obtain the name of the Servlet.
    `java.lang.String` | `getRunAsRole()` | Obtain the name of the user / group under which the Servlet has been configured to run.
    `void` | `setAsyncSupported​(boolean asyncSupported)` | Mark this Servlet/Filter as supported asynchronous processing.
    `boolean` | `setInitParameter​(java.lang.String name, java.lang.String value)` | Add an initialisation parameter if not already added.
    `java.util.Set<java.lang.String>` | `setInitParameters​(java.util.Map<java.lang.String,​java.lang.String> initParameters)` | Add multiple initialisation parameters.
    `void` | `setLoadOnStartup​(int loadOnStartup)` | Set the loadOnStartup order for the Servlet
    `void` | `setMultipartConfig​(MultipartConfigElement multipartConfig)` | Set the multi-part configuration for the associated Servlet.
    `void` | `setRunAsRole​(java.lang.String roleName)` | Set the name of the user / group under which the Servlet should be configured to run.
    `java.util.Set<java.lang.String>` | `setServletSecurity​(ServletSecurityElement constraint)` | Add security constraints to this Servlet.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ApplicationServletRegistration

          public ApplicationServletRegistration​(Wrapper wrapper,
                                                Context context)

  - ### Method Detail

    - #### getClassName

          public java.lang.String getClassName()

      Description copied from interface: `javax.servlet.Registration`
      Obtain the name of the implementation class for the Servlet.
      Specified by:
        `getClassName` in interface `Registration`
      Returns:
        the name of the implementation class for the Servlet.

    - #### getInitParameter

          public java.lang.String getInitParameter​(java.lang.String name)

      Description copied from interface: `javax.servlet.Registration`
      Get the value of an initialisation parameter.
      Specified by:
        `getInitParameter` in interface `Registration`
      Parameters:
        `name` - The initialisation parameter whose value is required
      Returns:
        The value of the named initialisation parameter

    - #### getInitParameters

          public java.util.Map<java.lang.String,​java.lang.String> getInitParameters()

      Description copied from interface: `javax.servlet.Registration`
      Get the names and values of all the initialisation parameters.
      Specified by:
        `getInitParameters` in interface `Registration`
      Returns:
        A Map of initialisation parameter names and associated values keyed by name

    - #### getName

          public java.lang.String getName()

      Description copied from interface: `javax.servlet.Registration`
      Obtain the name of the Servlet.
      Specified by:
        `getName` in interface `Registration`
      Returns:
        the name of the Servlet.

    - #### setInitParameter

          public boolean setInitParameter​(java.lang.String name,
                                          java.lang.String value)

      Description copied from interface: `javax.servlet.Registration`
      Add an initialisation parameter if not already added.
      Specified by:
        `setInitParameter` in interface `Registration`
      Parameters:
        `name` - Name of initialisation parameter
        `value` - Value of initialisation parameter
      Returns:
        `true` if the initialisation parameter was set, `false` if the initialisation parameter was not set because an initialisation parameter of the same name already existed

    - #### setInitParameters

          public java.util.Set<java.lang.String> setInitParameters​(java.util.Map<java.lang.String,​java.lang.String> initParameters)

      Description copied from interface: `javax.servlet.Registration`
      Add multiple initialisation parameters. If any of the supplied initialisation parameter conflicts with an existing initialisation parameter, no updates will be performed.
      Specified by:
        `setInitParameters` in interface `Registration`
      Parameters:
        `initParameters` - The initialisation parameters to add
      Returns:
        The set of initialisation parameter names that conflicted with existing initialisation parameter. If there are no conflicts, this Set will be empty.

    - #### setAsyncSupported

          public void setAsyncSupported​(boolean asyncSupported)

      Description copied from interface: `javax.servlet.Registration.Dynamic`
      Mark this Servlet/Filter as supported asynchronous processing.
      Specified by:
        `setAsyncSupported` in interface `Registration.Dynamic`
      Parameters:
        `asyncSupported` - Should this Servlet/Filter support asynchronous processing

    - #### setLoadOnStartup

          public void setLoadOnStartup​(int loadOnStartup)

      Description copied from interface: `javax.servlet.ServletRegistration.Dynamic`
      Set the loadOnStartup order for the Servlet
      Specified by:
        `setLoadOnStartup` in interface `ServletRegistration.Dynamic`
      Parameters:
        `loadOnStartup` - The position in the order the Servlet should be started (higher numbers are started after lower numbers)

    - #### setMultipartConfig

          public void setMultipartConfig​(MultipartConfigElement multipartConfig)

      Description copied from interface: `javax.servlet.ServletRegistration.Dynamic`
      Set the multi-part configuration for the associated Servlet. To clear the multi-part configuration specify `null` as the new value.
      Specified by:
        `setMultipartConfig` in interface `ServletRegistration.Dynamic`
      Parameters:
        `multipartConfig` - The configuration to associate with the Servlet

    - #### setRunAsRole

          public void setRunAsRole​(java.lang.String roleName)

      Description copied from interface: `javax.servlet.ServletRegistration.Dynamic`
      Set the name of the user / group under which the Servlet should be configured to run.
      Specified by:
        `setRunAsRole` in interface `ServletRegistration.Dynamic`
      Parameters:
        `roleName` - name of the user / group or `null` if none

    - #### setServletSecurity

          public java.util.Set<java.lang.String> setServletSecurity​(ServletSecurityElement constraint)

      Description copied from interface: `javax.servlet.ServletRegistration.Dynamic`
      Add security constraints to this Servlet.
      Specified by:
        `setServletSecurity` in interface `ServletRegistration.Dynamic`
      Parameters:
        `constraint` - new security constraints for this Servlet
      Returns:
        urls currently mapped to this registration that are already present in web.xml

    - #### addMapping

          public java.util.Set<java.lang.String> addMapping​(java.lang.String... urlPatterns)

      Description copied from interface: `javax.servlet.ServletRegistration`
      Adds a servlet mapping with the given URL patterns for the Servlet represented by this ServletRegistration. If any of the specified URL patterns are already mapped to a different Servlet, no updates will be performed. If this method is called multiple times, each successive call adds to the effects of the former. The returned set is not backed by the ServletRegistration object, so changes in the returned set are not reflected in the ServletRegistration object, and vice-versa.
      Specified by:
        `addMapping` in interface `ServletRegistration`
      Parameters:
        `urlPatterns` - The URL patterns that this Servlet should be mapped to
      Returns:
        the (possibly empty) Set of URL patterns that are already mapped to a different Servlet

    - #### getMappings

          public java.util.Collection<java.lang.String> getMappings()

      Description copied from interface: `javax.servlet.ServletRegistration`
      Gets the currently available mappings of the Servlet represented by this ServletRegistration. If permitted, any changes to the returned Collection must not affect this ServletRegistration.
      Specified by:
        `getMappings` in interface `ServletRegistration`
      Returns:
        a (possibly empty) Collection of the currently available mappings of the Servlet represented by this ServletRegistration

    - #### getRunAsRole

          public java.lang.String getRunAsRole()

      Description copied from interface: `javax.servlet.ServletRegistration`
      Obtain the name of the user / group under which the Servlet has been configured to run.
      Specified by:
        `getRunAsRole` in interface `ServletRegistration`
      Returns:
        the name of the user / group or `null` if none has been specified