Top Description Inners Methods
jakarta.servlet.annotation

public @Interface ServletSecurity

extends Annotation
Annotations
@Inherited
@Target:TYPE
@Retention:RUNTIME
@Documented
Imports
java.lang.annotation.Documented, .ElementType, .Inherited, .Retention, .RetentionPolicy, .Target

Declare this annotation on a jakarta.servlet.Servlet implementation class to enforce security constraints on HTTP protocol requests.
The container applies constraints to the URL patterns mapped to each Servlet which declares this annotation.

Since
Servlet 3.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
ServletSecurity.EmptyRoleSemantic

Represents the two possible values of the empty role semantic, active when a list of role names is empty.

public static enum
ServletSecurity.TransportGuarantee

Represents the two possible values of data transport, encrypted or not.

Method Summary

Modifier and TypeMethod and Description
public HttpMethodConstraint[]

Returns:

array of http method constraint
httpMethodConstraints
()

An array of HttpMethodConstraint objects to which the security constraint will be applied

public HttpConstraint

Returns:

http constraint
value
()

The default constraint to apply to requests not handled by specific method constraints

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

httpMethodConstraintsback to summary
public HttpMethodConstraint[] httpMethodConstraints()

An array of HttpMethodConstraint objects to which the security constraint will be applied

Returns:HttpMethodConstraint[]

array of http method constraint

valueback to summary
public HttpConstraint value()

The default constraint to apply to requests not handled by specific method constraints

Returns:HttpConstraint

http constraint

jakarta.servlet.annotation back to summary

public final Enum ServletSecurity.EmptyRoleSemantic

extends Enum<ServletSecurity.EmptyRoleSemantic>
Class Inheritance

Represents the two possible values of the empty role semantic, active when a list of role names is empty.

Field Summary

Modifier and TypeField and Description
public static final ServletSecurity.EmptyRoleSemantic
DENY

Access MUST be denied, regardless of authentication state or identity

public static final ServletSecurity.EmptyRoleSemantic
PERMIT

Access MUST be permitted, regardless of authentication state or identity

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static ServletSecurity.EmptyRoleSemantic
public static ServletSecurity.EmptyRoleSemantic[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

DENYback to summary
public static final ServletSecurity.EmptyRoleSemantic DENY

Access MUST be denied, regardless of authentication state or identity

PERMITback to summary
public static final ServletSecurity.EmptyRoleSemantic PERMIT

Access MUST be permitted, regardless of authentication state or identity

Constructor Detail

EmptyRoleSemanticback to summary
private EmptyRoleSemantic()

Method Detail

valueOfback to summary
public static ServletSecurity.EmptyRoleSemantic valueOf(String name)
valuesback to summary
public static ServletSecurity.EmptyRoleSemantic[] values()
jakarta.servlet.annotation back to summary

public final Enum ServletSecurity.TransportGuarantee

extends Enum<ServletSecurity.TransportGuarantee>
Class Inheritance

Represents the two possible values of data transport, encrypted or not.

Field Summary

Modifier and TypeField and Description
public static final ServletSecurity.TransportGuarantee
CONFIDENTIAL

The container MUST encrypt user data during transport

public static final ServletSecurity.TransportGuarantee
NONE

User data must not be encrypted by the container during transport

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static ServletSecurity.TransportGuarantee
public static ServletSecurity.TransportGuarantee[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

CONFIDENTIALback to summary
public static final ServletSecurity.TransportGuarantee CONFIDENTIAL

The container MUST encrypt user data during transport

NONEback to summary
public static final ServletSecurity.TransportGuarantee NONE

User data must not be encrypted by the container during transport

Constructor Detail

TransportGuaranteeback to summary
private TransportGuarantee()

Method Detail

valueOfback to summary
public static ServletSecurity.TransportGuarantee valueOf(String name)
valuesback to summary
public static ServletSecurity.TransportGuarantee[] values()