JSP and Servlets Fundamentals

Test your knowledge of Java Server Pages (JSP) and Servlet technologies including syntax, scopes, life cycle, and server configuration.

20 Questions Published

Questions

Question 1 True/False

A servlet can handle multiple requests concurrently.

  1. True
  2. False
Question 2 True/False

Through a ServletContext object, servlets can interact with their enviornment.

  1. True
  2. False
Question 3 Multiple Choice (Single Answer)

. To get an object of PrintWriter, we use getWriter() method of class _____________

  1. HttpSession
  2. HttpServletResponse
  3. HttpServletRequest
  4. none
Question 4 Multiple Choice (Single Answer)

A life-cycle method of a servlet is_________________

  1. init()
  2. service()
  3. destroy()
  4. Above All
Question 5 Multiple Choice (Single Answer)

Number of ServletContext object present for an application is __________

  1. 2
  2. 1
  3. not fixed
  4. 3
Question 6 Multiple Choice (Single Answer)

The method used for fetching object in the request object is __________

  1. getAttribute()
  2. getParameter()
  3. getInitParameter()
  4. none
Question 7 True/False

Servlets are multi threaded

  1. True
  2. False
Question 8 Multiple Choice (Single Answer)

In the init(ServletConfig) method of Servlet life cycle, what method can be used to access the ServletConfig object ?

  1. getServletInfo()
  2. getInitParameters()
  3. getServletConfig()
  4. none
Question 9 Multiple Choice (Single Answer)

Which of the following is server side programming languages? 1 HTML 2 JavaScript 3 JSP 4 Sevlets

  1. 1,2,3,4
  2. 1,2
  3. 3,4
  4. none
Question 10 Multiple Choice (Single Answer)

What JSP stand for

  1. Java Server Pages
  2. Java Server Programming
  3. Java Service Pages
  4. Java Service Programming
Question 11 Multiple Choice (Single Answer)

What JSP is basically used today

  1. To make controller
  2. To make GUI
  3. In writing business logic
  4. Deprecated
  5. none
Question 12 True/False

We must have configure and map all jsp files into web.xml

  1. True
  2. False
Question 13 Multiple Choice (Multiple Answers)

JSP can run by

  1. Apache Tomact
  2. Bea WebLogic
  3. Servlets
  4. JSP Engine
Question 14 Multiple Choice (Multiple Answers)

IBM WebSphere is?

  1. A full-featured Web Application Server
  2. It provides supports to the Servlet and JSP
  3. . It includes pooled database access for DB2 and Oracle Relational Databases
  4. Provide support for EJB .
Question 15 Multiple Choice (Single Answer)

Syntax of Scriptlet Element

  1. <% code %>
  2. <@jsp code %>
  3. <jsp: scriptlet code />
  4. <%jsp code %>
Question 16 Multiple Choice (Single Answer)

Syntax of Declaration Element

  1. <%! code !%>
  2. <%! code %>
  3. <jsp: scriptlet code />
  4. <%jsp code !%>
Question 17 Multiple Choice (Single Answer)

JSP Syntax of comments

  1. <%-- comment --%>
  2. <!-- comment -->
  3. <% // comment %>
  4. <% /* comment */ %>
  5. <% /** comment */ %>
Question 18 Multiple Choice (Single Answer)

Choose correct scopes into JSP:-

  1. page, request, session, application
  2. Page, response, session, application
  3. Page, request, response, session
  4. None
Question 19 Multiple Choice (Single Answer)

Choose JavaBean Actions:-

  1. useBean
  2. setProperty
  3. getProperty
  4. All
  5. none
Question 20 Multiple Choice (Single Answer)

In jsp:useBean which two attributes is necessary

  1. id and scope
  2. class or beanName.
  3. type and id
  4. None