Package javax.servlet
Class ServletSecurityElement
- java.lang.Object
- 
- javax.servlet.HttpConstraintElement
- 
- javax.servlet.ServletSecurityElement
 
 
- 
 public class ServletSecurityElement extends HttpConstraintElement The programmatic equivalent ofServletSecurityused to configre security constraints for a Servlet.- Since:
- Servlet 3.0
 
- 
- 
Constructor SummaryConstructors Constructor Description ServletSecurityElement()Use default HttpConstraint.ServletSecurityElement(java.util.Collection<HttpMethodConstraintElement> httpMethodConstraints)Use specific constraints for specified methods and default HttpConstraintElement for all other methods.ServletSecurityElement(ServletSecurity annotation)Create from an annotation.ServletSecurityElement(HttpConstraintElement httpConstraintElement)Use specified HttpConstraintElement.ServletSecurityElement(HttpConstraintElement httpConstraintElement, java.util.Collection<HttpMethodConstraintElement> httpMethodConstraints)Use specified HttpConstraintElement as default and specific constraints for specified methods.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<HttpMethodConstraintElement>getHttpMethodConstraints()Obtain the collection of security constraints configured for specific methods.java.util.Collection<java.lang.String>getMethodNames()Obtain the collection HTTP methods for which security constraints have been defined.- 
Methods inherited from class javax.servlet.HttpConstraintElementgetEmptyRoleSemantic, getRolesAllowed, getTransportGuarantee
 
- 
 
- 
- 
- 
Constructor Detail- 
ServletSecurityElementpublic ServletSecurityElement() Use default HttpConstraint.
 - 
ServletSecurityElementpublic ServletSecurityElement(HttpConstraintElement httpConstraintElement) Use specified HttpConstraintElement.- Parameters:
- httpConstraintElement- The constraint
 
 - 
ServletSecurityElementpublic ServletSecurityElement(java.util.Collection<HttpMethodConstraintElement> httpMethodConstraints) Use specific constraints for specified methods and default HttpConstraintElement for all other methods.- Parameters:
- httpMethodConstraints- Method constraints
- Throws:
- java.lang.IllegalArgumentException- if a method name is specified more than once
 
 - 
ServletSecurityElementpublic ServletSecurityElement(HttpConstraintElement httpConstraintElement, java.util.Collection<HttpMethodConstraintElement> httpMethodConstraints) Use specified HttpConstraintElement as default and specific constraints for specified methods.- Parameters:
- httpConstraintElement- Default constraint
- httpMethodConstraints- Method constraints
- Throws:
- java.lang.IllegalArgumentException- if a method name is specified more than once
 
 - 
ServletSecurityElementpublic ServletSecurityElement(ServletSecurity annotation) Create from an annotation.- Parameters:
- annotation- Annotation to use as the basis for the new instance
- Throws:
- java.lang.IllegalArgumentException- if a method name is specified more than once
 
 
- 
 - 
Method Detail- 
getHttpMethodConstraintspublic java.util.Collection<HttpMethodConstraintElement> getHttpMethodConstraints() Obtain the collection of security constraints configured for specific methods.- Returns:
- The security constraints for specific methods
 
 - 
getMethodNamespublic java.util.Collection<java.lang.String> getMethodNames() Obtain the collection HTTP methods for which security constraints have been defined.- Returns:
- The names of the HTTP methods
 
 
- 
 
-