Package jakarta.servlet
Class ServletSecurityElement
java.lang.Object
jakarta.servlet.HttpConstraintElement
jakarta.servlet.ServletSecurityElement
The programmatic equivalent of 
ServletSecurity used to configre security
 constraints for a Servlet.- Since:
- Servlet 3.0
- 
Constructor SummaryConstructorsConstructorDescriptionUse default HttpConstraint.ServletSecurityElement(ServletSecurity annotation) Create from an annotation.ServletSecurityElement(HttpConstraintElement httpConstraintElement) Use specified HttpConstraintElement.ServletSecurityElement(HttpConstraintElement httpConstraintElement, Collection<HttpMethodConstraintElement> httpMethodConstraints) Use specified HttpConstraintElement as default and specific constraints for specified methods.ServletSecurityElement(Collection<HttpMethodConstraintElement> httpMethodConstraints) Use specific constraints for specified methods and default HttpConstraintElement for all other methods.
- 
Method SummaryModifier and TypeMethodDescriptionObtain the collection of security constraints configured for specific methods.Obtain the collection HTTP methods for which security constraints have been defined.Methods inherited from class jakarta.servlet.HttpConstraintElementgetEmptyRoleSemantic, getRolesAllowed, getTransportGuarantee
- 
Constructor Details- 
ServletSecurityElementpublic ServletSecurityElement()Use default HttpConstraint.
- 
ServletSecurityElementUse specified HttpConstraintElement.- Parameters:
- httpConstraintElement- The constraint
 
- 
ServletSecurityElementUse specific constraints for specified methods and default HttpConstraintElement for all other methods.- Parameters:
- httpMethodConstraints- Method constraints
- Throws:
- IllegalArgumentException- if a method name is specified more than once
 
- 
ServletSecurityElementpublic ServletSecurityElement(HttpConstraintElement httpConstraintElement, Collection<HttpMethodConstraintElement> httpMethodConstraints) Use specified HttpConstraintElement as default and specific constraints for specified methods.- Parameters:
- httpConstraintElement- Default constraint
- httpMethodConstraints- Method constraints
- Throws:
- IllegalArgumentException- if a method name is specified more than once
 
- 
ServletSecurityElementCreate from an annotation.- Parameters:
- annotation- Annotation to use as the basis for the new instance
- Throws:
- IllegalArgumentException- if a method name is specified more than once
 
 
- 
- 
Method Details- 
getHttpMethodConstraintsObtain the collection of security constraints configured for specific methods.- Returns:
- The security constraints for specific methods
 
- 
getMethodNamesObtain the collection HTTP methods for which security constraints have been defined.- Returns:
- The names of the HTTP methods
 
 
-