Class ServletSecurityAnnotationHandler
java.lang.Object
org.eclipse.jetty.ee10.annotations.AnnotationIntrospector.AbstractIntrospectableAnnotationHandler
org.eclipse.jetty.ee10.annotations.ServletSecurityAnnotationHandler
- All Implemented Interfaces:
AnnotationIntrospector.IntrospectableAnnotationHandler
public class ServletSecurityAnnotationHandler
extends AnnotationIntrospector.AbstractIntrospectableAnnotationHandler
Inspect a class to see if it has an @ServletSecurity
annotation on it,
setting up the <security-constraint>s
.
A servlet can be defined in:
- web.xml
- web-fragment.xml
- @WebServlet annotation discovered
- ServletContext.createServlet
The ServletSecurity annotation for a servlet should only be processed iff metadata-complete == false.
-
Field Summary
Fields inherited from class org.eclipse.jetty.ee10.annotations.AnnotationIntrospector.AbstractIntrospectableAnnotationHandler
_context, _introspectAncestors
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
constraintsExist
(List<ServletMapping> servletMappings, List<ConstraintMapping> constraintMappings) Check if there are already<security-constraint>
elements defined that match the url-patterns for the servlet.void
protected List<ServletMapping>
getServletMappings
(String className) Get the ServletMappings for the servlet's class.Methods inherited from class org.eclipse.jetty.ee10.annotations.AnnotationIntrospector.AbstractIntrospectableAnnotationHandler
getContext, handle
-
Constructor Details
-
ServletSecurityAnnotationHandler
-
-
Method Details
-
doHandle
- Specified by:
doHandle
in classAnnotationIntrospector.AbstractIntrospectableAnnotationHandler
-
getServletMappings
Get the ServletMappings for the servlet's class.- Parameters:
className
- the class name- Returns:
- the servlet mappings for the class
-
constraintsExist
protected boolean constraintsExist(List<ServletMapping> servletMappings, List<ConstraintMapping> constraintMappings) Check if there are already<security-constraint>
elements defined that match the url-patterns for the servlet.- Parameters:
servletMappings
- the servlet mappingsconstraintMappings
- the constraint mappings- Returns:
- true if constraint exists
-