Which code snippet specifies the metadata for a servlet with:
(i) url mapping “/mytest”‘
(ii) Initial parameter with name “debug” and value “10”‘ (iii) Support asynchronous operation?
A.
@WebServlet(“/mytest”)
@InitParam(name-“debug” va1ue = “10”)
@Asynchronous
public class TestServlet extends HttpServlet {}
B.
@WebServlet (“/myset”)
@WebParam(name = “debug” value = “10”)
Public class testServlet {}
C.
@WebServlet (urlPatterns = { / “mytest”},
Initparams = {@InitParam (name = “debug”, value = “10”) }, supportAsync = true) public class TestServlet extends HttpServlet {}
D.
@WebServlet (urlPatterns = { / “mytest”},
Initparams = {@InitParam (name = “debug”, value= “10”) }, asyncSupported = true) public class TestServlet extends HttpServlet {}
E.
@WebServlet (urlPatterns = { / “mytest”},
Initparam = @WebInitParam (name = “debug”, value = “10”), supportAsync = true) public class testServlet {}
The Correct answer is : D
D is correct but it must be “@WebInitParam”
D is the correct answer
D.
It is the only option that use the correct asynchronous operation property.