Select chapter



basics (7.papers)
constructors (1.papers)
packages (1.papers)
inheritance (7.papers)
misc (3.papers)
exceptions (5.papers)
threads (4.papers)
overloading (1.papers)
jsp (3.papers)
servlets (9.papers)
jdbc (2.papers)
util (1.papers)
xml (2.papers)
IO stream (3.papers)
Hide

Sponsored Links


  

java servlets interview questions and answers

Show Answer
Share Facebook gmail Twitter
2
Which of the following statements are correct about the status of the Http response.
  1. A status of 200 to 299 signifies that the request was successful.
  2. A status of 300 to 399 are informational messages.
  3. A status of 400 to 499 indicates an error in the server.
  4. status of 500 to 599 indicates an error in the client.
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
4
Which listener callbacks responds when a value object is transported across JVM’s ?
  1. HttpSessionListener
  2. ServletContextListener
  3. HttpSessionBindingListener
  4. HttpSessionActivationListener
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
6
Which method of HttpServletResponse can be used to  set the response content type?
  1.  void   setType(String a)
  2.  void   setContent(String s)
  3.  void  setContentType(String s)
  4. void setResponseContentType(String a)
Show Answer
Share Facebook gmail Twitter
7
Which of the following is valid method  in a class that extends HttpServlet?
  1. protected void service(HttpServletRequest request, HttpServletResponse response) throws  IOException
  2.  protected void init(){}
  3. protected void destroy(){}
  4. protected void service(ServletRequest request, ServletResponse response) throws  IOException
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
10
Path specified in getRequestDispatcher method of ServletContext class is 
  1.  full path of the servlet
  2.  relative  path of the servlet
Show Answer
Share Facebook gmail Twitter
11
HttpServletRequest and HttpServletResponse interface is implemented by
  1. Servlet container
  2. Server
  3. Programmer
  4. By both programmer and Servlet Container
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
15
Which method of HttpServletResponse can be used to set the MIME type?
  1. setMIMEType()
  2. setMimeType()
  3. setMIME()
  4. setContentType
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
17
There will be only one __________  object for each web application 
  1. ServletContext
  2. ServletConfig
  3. HttpSession
  4. HttpServlet
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
19
Which set of HTTP status codes represents error in client request?
  1. Codes starting from 200
  2. Codes starting from 300
  3. Codes starting from 400
  4. Codes starting from 500
Show Answer
Share Facebook gmail Twitter
20
 Which are methods of the HttpSessionActivationListener interface?
  1. sessionActivated
  2. sessionDeactivated
  3. sessionDidActivate
  4. sessionWillActivate
Show Answer
Share Facebook gmail Twitter
Read more papers :