I can find the below question recurrent in many mock exams
8. Given:
3: class MyServlet extends HttpServlet {
4: public void doPut(HttpServletRequest req,
HttpServletResponse resp)
throws ServletException, IOException {
5: // servlet code here
...
26: }
27: }
If the DD contains a single security constraint associated with MyServlet and its only <httpmethod>
tags
and <authconstraint>
tags are:
<httpmethod>
GET</httpmethod>
<httpmethod>
PUT</httpmethod>
<authconstraint>
Admin</authconstraint>
Which four requests would be allowed by the container? (Choose four.)
A. A user whose role is Admin can perform a PUT.
B. A user whose role is Admin can perform a GET.
C. A user whose role is Admin can perform a POST.
D. A user whose role is Member can perform a PUT.
E. A user whose role is Member can perform a POST.
F. A user whose role is Member can perform a GET.
Answer: ABCE
I think that the answer is incorrect, because put method is the only http method implemented in MyServlet, All other methods regards of their security constraint will rely with http error 405 "Method is not supported"
So I guess the correct answer would be A only.
I know that the same question above has been posted before, however they were having different concerns than mine.
Please let me know, if my understanding is wrong.