Exam 1z0-900 All QuestionsBrowse all questions from this exam
Question 19

Given the code fragment:

When the context root is requested http://host:port/context, how does the container resolve this mapping?

    Correct Answer: C

    The provided servlet mappings include conflicting URL patterns. The servlets 'secondServlet' and 'thirdServlet' are both mapped to the url-pattern '/', which is not permitted by the servlet specification. This leads to an IllegalArgumentException during the startup of the servlet container. Therefore, the container throws an error at startup due to the conflicting servlet mappings.

Discussion
devmsalehOption: C

Correct answer is C and tested on eclipse : java.lang.IllegalArgumentException: The servlets named [secondServlet] and [thirdServlet] are both mapped to the url-pattern [/] which is not permitted

LeoAliothOption: B

answer B is correct

orjavaOption: C

Answer C