Top Description Methods
jakarta.servlet.annotation

public @Interface HttpMethodConstraint

extends Annotation
Annotations
@Retention:RUNTIME
@Documented
Imports
java.lang.annotation.Documented, .Retention, .RetentionPolicy, jakarta.servlet.annotation.ServletSecurity.EmptyRoleSemantic, .ServletSecurity.TransportGuarantee

Specific security constraints can be applied to different types of request, differentiated by the HTTP protocol method type by using this annotation inside the jakarta.servlet.annotation.ServletSecurity annotation.
Since
Servlet 3.0

Method Summary

Modifier and TypeMethod and Description
public ServletSecurity.EmptyRoleSemantic

Returns:

empty role semantic
emptyRoleSemantic
()

The EmptyRoleSemantic determines the behaviour when the rolesAllowed list is empty.

public String[]

Returns:

array of names. The array may be of zero length, in which case the EmptyRoleSemantic applies; the returned value determines whether access is to be permitted or denied regardless of the identity and authentication state in either case, PERMIT or DENY.
Otherwise, when the array contains one or more role names access is permitted if the user a member of at least one of the named roles. The EmptyRoleSemantic is not applied in this case.
rolesAllowed
()

The authorized roles' names.

public ServletSecurity.TransportGuarantee

Returns:

transport guarantee
transportGuarantee
()

Determines whether SSL/TLS is required to process the current request.

public String

Returns:

method name
value
()

HTTP Protocol method name (e.g. POST, PUT)

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

emptyRoleSemanticback to summary
public ServletSecurity.EmptyRoleSemantic emptyRoleSemantic()

The EmptyRoleSemantic determines the behaviour when the rolesAllowed list is empty.

Returns:ServletSecurity.EmptyRoleSemantic

empty role semantic

rolesAllowedback to summary
public String[] rolesAllowed()

The authorized roles' names. The container may discard duplicate role names during processing of the annotation. N.B. The String "*" does not have a special meaning if it occurs as a role name.

Returns:String[]

array of names. The array may be of zero length, in which case the EmptyRoleSemantic applies; the returned value determines whether access is to be permitted or denied regardless of the identity and authentication state in either case, PERMIT or DENY.
Otherwise, when the array contains one or more role names access is permitted if the user a member of at least one of the named roles. The EmptyRoleSemantic is not applied in this case.

transportGuaranteeback to summary
public ServletSecurity.TransportGuarantee transportGuarantee()

Determines whether SSL/TLS is required to process the current request.

Returns:ServletSecurity.TransportGuarantee

transport guarantee

valueback to summary
public String value()

HTTP Protocol method name (e.g. POST, PUT)

Returns:String

method name