public class ServletSecurityAnnotationHandler extends AnnotationIntrospector.AbstractIntrospectableAnnotationHandler
@ServletSecurity
annotation on it,
setting up the <security-constraint>s
.
A servlet can be defined in:
Constructor and Description |
---|
ServletSecurityAnnotationHandler(WebAppContext wac) |
Modifier and Type | Method and Description |
---|---|
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. |
void |
doHandle(Class clazz) |
protected List<ServletMapping> |
getServletMappings(String className)
Get the ServletMappings for the servlet's class.
|
protected Constraint |
makeConstraint(Class servlet,
String[] rolesAllowed,
ServletSecurity.EmptyRoleSemantic permitOrDeny,
ServletSecurity.TransportGuarantee transport)
Make a jetty Constraint object, which represents the
<auth-constraint> and
<user-data-constraint> elements, based on the security annotation. |
handle
public ServletSecurityAnnotationHandler(WebAppContext wac)
public void doHandle(Class clazz)
protected Constraint makeConstraint(Class servlet, String[] rolesAllowed, ServletSecurity.EmptyRoleSemantic permitOrDeny, ServletSecurity.TransportGuarantee transport)
<auth-constraint>
and
<user-data-constraint>
elements, based on the security annotation.servlet
- the servletrolesAllowed
- the roles allowedpermitOrDeny
- the role / permission semantictransport
- the transport guaranteeprotected List<ServletMapping> getServletMappings(String className)
className
- the class nameprotected boolean constraintsExist(List<ServletMapping> servletMappings, List<ConstraintMapping> constraintMappings)
<security-constraint>
elements defined that match the url-patterns for
the servlet.servletMappings
- the servlet mappingsconstraintMappings
- the constraint mappingsCopyright © 1995-2016 Webtide. All Rights Reserved.