Which of the following annotations relate to security in a servlet?

Which of the following annotations relate to security in a servlet?
(i) @WebSecurity
(ii) @RolesAllowed
(iii) @WebConstraint
(iv) @HttpConstraint
(v) @Servletsecurity

Which of the following annotations relate to security in a servlet?
(i) @WebSecurity
(ii) @RolesAllowed
(iii) @WebConstraint
(iv) @HttpConstraint
(v) @Servletsecurity

A.
(i) only

B.
(i) and (iii)

C.
(iv) and (v)

D.
(iii) and (v)

E.
(ii) and (iv)



Leave a Reply 4

Your email address will not be published. Required fields are marked *


noname

noname

strange… in servlet 3.0 (JEE6) @RolesAllowed is used for security too…

Neo

Neo

C

@WebServlet(“/manage”)
@ServletSecurity(@HttpConstraint(rolesAllowed = “admin”))
public class AdminServlet extends HttpServlet {
// servlet code…
}