Top Description Inners Methods
jakarta.servlet

public Interface Registration

Known Direct Subinterfaces
jakarta.servlet.Registration.Dynamic, jakarta.servlet.ServletRegistration, jakarta.servlet.FilterRegistration
Imports
java.util.Map, .Set

Common interface for the registration of Filters and Servlets.
Since
Servlet 3.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
Registration.Dynamic

Interface through which a Servlet or Filter registered via one of the addServlet or addFilter methods, respectively, on ServletContext may be further configured.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the name of the implementation class for the Servlet.
getClassName
()

Obtain the name of the implementation class for the Servlet.

public String

Returns:

The value of the named initialisation parameter
getInitParameter
(String
The initialisation parameter whose value is required
name
)

Get the value of an initialisation parameter.

public Map<String, String>

Returns:

A Map of initialisation parameter names and associated values keyed by name
getInitParameters
()

Get the names and values of all the initialisation parameters.

public String

Returns:

the name of the Servlet.
getName
()

Obtain the name of the Servlet.

public boolean

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
setInitParameter
(String
Name of initialisation parameter
name
,
String
Value of initialisation parameter
value
)

Add an initialisation parameter if not already added.

public Set<String>

Returns:

The set of initialisation parameter names that conflicted with existing initialisation parameter. If there are no conflicts, this Set will be empty.
setInitParameters
(Map<String, String>
The initialisation parameters to add
initParameters
)

Add multiple initialisation parameters.

Method Detail

getClassNameback to summary
public String getClassName()

Obtain the name of the implementation class for the Servlet.

Returns:String

the name of the implementation class for the Servlet.

getInitParameterback to summary
public String getInitParameter(String name)

Get the value of an initialisation parameter.

Parameters
name:String

The initialisation parameter whose value is required

Returns:String

The value of the named initialisation parameter

getInitParametersback to summary
public Map<String, String> getInitParameters()

Get the names and values of all the initialisation parameters.

Returns:Map<String, String>

A Map of initialisation parameter names and associated values keyed by name

getNameback to summary
public String getName()

Obtain the name of the Servlet.

Returns:String

the name of the Servlet.

setInitParameterback to summary
public boolean setInitParameter(String name, String value)

Add an initialisation parameter if not already added.

Parameters
name:String

Name of initialisation parameter

value:String

Value of initialisation parameter

Returns:boolean

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

Exceptions
IllegalArgumentException:
if name or value is null
IllegalStateException:
if the ServletContext associated with this registration has already been initialised
setInitParametersback to summary
public Set<String> setInitParameters(Map<String, String> initParameters)

Add multiple initialisation parameters. If any of the supplied initialisation parameter conflicts with an existing initialisation parameter, no updates will be performed.

Parameters
initParameters:Map<String, String>

The initialisation parameters to add

Returns:Set<String>

The set of initialisation parameter names that conflicted with existing initialisation parameter. If there are no conflicts, this Set will be empty.

Exceptions
IllegalArgumentException:
if any of the supplied initialisation parameters have a null name or value
IllegalStateException:
if the ServletContext associated with this registration has already been initialised
jakarta.servlet back to summary

public Interface Registration.Dynamic

extends Registration
Known Direct Subinterfaces
jakarta.servlet.ServletRegistration.Dynamic, jakarta.servlet.FilterRegistration.Dynamic

Interface through which a Servlet or Filter registered via one of the addServlet or addFilter methods, respectively, on ServletContext may be further configured.

Method Summary

Modifier and TypeMethod and Description
public void
setAsyncSupported(boolean
Should this Servlet/Filter support asynchronous processing
isAsyncSupported
)

Mark this Servlet/Filter as supported asynchronous processing.

Inherited from jakarta.servlet.Registration:
getClassNamegetInitParametergetInitParametersgetNamesetInitParametersetInitParameters

Method Detail

setAsyncSupportedback to summary
public void setAsyncSupported(boolean isAsyncSupported)

Mark this Servlet/Filter as supported asynchronous processing.

Parameters
isAsyncSupported:boolean

Should this Servlet/Filter support asynchronous processing

Exceptions
IllegalStateException:
if the ServletContext associated with this registration has already been initialised