Servlets - Quiz
Servlets - Quiz
A. service
B. init
C. init followed by service
D. service followed by init
Q2 : Apart from GET and POST the other HTTP
method are
A. 1, ServletContext
B. 2, ServletRequest, ServletResponse
C. 0
D. 1, ServletConfig
Q4 : Which method of ServletConfig is used to
access the initialization parameters specified
in web.xml?
A. getInitParameterNames()
B. getInitParameterList()
C. getInitParameters()
D. getParameters()
Q5 : We can obtain the object of ServletContext
from ?
A. getServerPort(), getServerName()
B. getProtocol(), getCharacterEncoding()
C. getRemoteAddress(), getRemoteHost()
D. getContentType(), getContentLength()
Q8 : In an HTML form which attribute signifies
the method to be used for submitting the
form and if not specified which is the default
method?
A. method, POST
B. method, GET
C. submit, GET
D. submit, POST
Q9 : The data which a user enters in a HTML
form element can be accessed in a servlet
via which method of ServletRequest?
A. getData
B. getAttribute
C. getParameterNames
D. getParameter
Q10 : Which method of ServletResponse is used
to write HTML response for the client
A. getWriter()
B. write()
C. writeHTML()
D. printHTML()
Q11 : The GenericServlet ?