Which code snippet specifies the metadata for a servlet with…?

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?

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 {}



Leave a Reply 2

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


G

G

There’s no @InitParam, only @WebInitParam exists, The answer would be D, but you need to correct @InitParam to @WebInitParam