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

1
Which interface defines  getSession() method? 
  1. ServletRequest
  2. ServletResponse
  3. HttpServletRequest
  4. HttpServletResponse
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
4
Which of the following statements are true
  1. The order of listener notification is not guaranteed when  web application is shutting down
  2. Listener invocation order is not predictable.
  3. The container registers listeners based on declarations in the deployment descriptor.
  4. The container registers listeners based on classes defined in a web application.
Show Answer
Share Facebook gmail Twitter
5
What is the name of DD in Web application?
  1. WEB.INF
  2. web.xml
  3. WEB.xml
  4. web.inf
Show Answer
Share Facebook gmail Twitter
6
For a JEE web application, web.xml is a 
  1. Development Descriptor
  2. Deployment Descriptor
  3. Direct Deployer
  4. Developer Deployer
Show Answer
Share Facebook gmail Twitter
7
How can a servlet instance be destroyed?
  1. by callling destroy() method from service() or doXXX() methods of HttpServlet
  2. by callling destroy() method from init() of HttpServlet
  3. by callling destroy() method from any of the HttpServlet methods
  4. destruction of servlet instance is at the discretion of the 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
11
Which of the following is true?
  1. The HttpSession works only if browser has cookie enabled
  2. The HttpSession works only if the form has hidden fields
  3. The HttpSession works even if browser has cookie disabled provided URL is encoded
  4. The HttpSession works even if browser has cookie disabled even if URL is not encoded
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
14
Which is  true about web.xml?
  1. web.xml  should be placed at the root folder of the web application
  2. web.xml  should be placed inside WEB-INF folder of the web application
  3. web.xml can should be placed inside WEB_INF folder of the web application
  4. web.xml can should be placed inside WEBINF folder of the web application
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
18
Which is not true about DD?
  1. web.xml is one of the several DD that a web application can have
  2. Web.xml can have many <servlet> declarations
  3. A <servlet-name> ties the <servlet> element to the <servlet-mapping> element.
  4. A <servlet-class> is the Java class.
Show Answer
Share Facebook gmail Twitter
19
URL rewriting involves
  1. appending a query string to the URL
  2. rewriting the relative URL to absolute URL 
  3. changing the servlet request URL to error page URL when the servlet request URL throws an exception
  4. changing the  request URL to error page URL when the  request URL is not available
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Read more papers :