πŸ“Š J2EE Technologies
Q. Which of the following package contains servlet classes?
  • (A) javax.servlet
  • (B) javax.servlet.http
  • (C) Both of the above
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (C) Both of the above
πŸ“Š J2EE Technologies
Q. How many ServletContext objects are available for an entire web application?
  • (A) One each per servlet
  • (B) One each per request
  • (C) One each per response
  • (D) Only one
πŸ’¬ Discuss
βœ… Correct Answer: (D) Only one
πŸ“Š J2EE Technologies
Q. The init parameter name and value pairs that are defined in web.xml file are handled by
  • (A) ServletConfig object
  • (B) ServletContext object
  • (C) ServletRequest object
  • (D) ServletResponse object
πŸ’¬ Discuss
βœ… Correct Answer: (A) ServletConfig object
πŸ“Š J2EE Technologies
Q. The life cycle of a servlet is managed by
  • (A) servlet context
  • (B) servlet container
  • (C) the supporting protocol (such as http or https)
  • (D) all of the above
πŸ’¬ Discuss
βœ… Correct Answer: (B) servlet container
πŸ“Š J2EE Technologies
Q. Servlet mapping defines
  • (A) an association between a URL pattern and a servlet
  • (B) an association between a URL pattern and a request page
  • (C) an association between a URL pattern and a response page
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (A) an association between a URL pattern and a servlet
πŸ“Š J2EE Technologies
Q. A servlet maintain session in
  • (A) Servlet container
  • (B) Servlet context
  • (C) Servlet request heap
  • (D) Servlet response heap
πŸ’¬ Discuss
βœ… Correct Answer: (B) Servlet context
πŸ“Š J2EE Technologies
Q. The getSession() method with „trueβ€Ÿ as its parameter [ getSession(true) ] it will return the appropriate session object when
  • (A) the session is completed
  • (B) the session object is passed to another method
  • (C) the session does not exists
  • (D) the session is existing
πŸ’¬ Discuss
βœ… Correct Answer: (D) the session is existing
πŸ“Š J2EE Technologies
Q. Which of the following are the session tracking techniques?
  • (A) URL rewriting, using session object, using response object, using hidden fields
  • (B) URL rewriting, using session object, using cookies, using hidden fields
  • (C) URL rewriting, using servlet object, using response object, using cookies
  • (D) URL rewriting, using request object, using response object, using session object
πŸ’¬ Discuss
βœ… Correct Answer: (B) URL rewriting, using session object, using cookies, using hidden fields
πŸ“Š J2EE Technologies
Q. Which method is used to specify before any lines that uses the PrintWriter?
  • (A) setPageType()
  • (B) setContextType()
  • (C) setContentType()
  • (D) setResponseType()
πŸ’¬ Discuss
βœ… Correct Answer: (C) setContentType()
πŸ“Š J2EE Technologies
Q. Which of the following is true about servlets?
  • (A) Servlets execute within the address space of web server
  • (B) Servlets are platform-independent because they are written in java
  • (C) Servlets can use the full functionality of the Java class libraries
  • (D) Servlets execute within the address space of web server, platform independent and uses the functionality of java class libraries
πŸ’¬ Discuss
βœ… Correct Answer: (D) Servlets execute within the address space of web server, platform independent and uses the functionality of java class libraries