Java Server Pages (JSP) Fundamentals

Test your knowledge of JSP tags, directives, sessions, error handling, and related Java web programming concepts

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

To show money format on the JSP page we use __________ class

  1. AirthmaticFormat
  2. CurrencyFormat
  3. NumberFormat ==
  4. StringBuffer
Question 2 Multiple Choice (Single Answer)

The information needed to create a TCP socket for communication in JSP is

  1. The Local Systems IP Address
  2. Local Systems Port Number
  3. Remote System’s IPAddress
  4. All of the above
Question 3 Multiple Choice (Single Answer)

Following methods can be overridden in the JSP page

  1. jspDestroy()
  2. jspInit()==
  3. _jspService()
  4. getParameter()
Question 4 Multiple Choice (Single Answer)

Which of the statement below does not correctly defines the difference between JDBC and ODBC ?

  1. ODBC can be directly used with Java because it uses a C interface
  2. ODBC makes uses of pointers which has been totally removed from JAVA
  3. ODBC is from Microsoft while JDBC is from java applications
  4. ODBC requires manual installation of the ODBC driver manager and driver on all client machines. While for JDBC driver are written in Java and JDBC code is automatically installable, secure and portable on all platforms.
Question 5 Multiple Choice (Single Answer)

Which of the following statements is true about JSP tag library?

  1. It defines the standard tag that works the same everywhere
  2. It is a single library and we can use it in multiple jsp containers
  3. It has support for the common structural tasks like iteration and condition
  4. All of the above
Question 6 Multiple Choice (Single Answer)

Java Server Pages specification includes

  1. Script language declarations, scriplets and expressions.
  2. JSP standard actions
  3. JSP standard directives
  4. All the Above
Question 7 Multiple Choice (Single Answer)

Which of the tag contains a code fragment valid in the page scripting language

  1. <%= expressions %>
  2. <% code fragment %
  3. <%! Declarations %>
  4. <%-- comment -- %>
Question 8 Multiple Choice (Single Answer)

The _______ when added to the user session tells us that the session timed out

  1. SessionTimedoutIndicator
  2. SessionTotalTimeOutIndicator
  3. SessionTotalTimedoutIndicator
  4. SessionTimeoutIndicator
Question 9 Multiple Choice (Single Answer)

Following method(s) cannot be overridden in the JSP page.

  1. jspDestroy()
  2. jspInit()
  3. _jspService()
  4. getParameter()
Question 10 Multiple Choice (Single Answer)

The tag %@include file=”.........” % > helps in including the ______ file in the JSP page

  1. readOnly==
  2. dynamic
  3. static==
  4. None of the above
Question 11 Multiple Choice (Single Answer)

When a JSP page is compiled, what is it turned into?

  1. Applet
  2. Servlet
  3. Application
  4. Midlet
Question 12 Multiple Choice (Single Answer)

Which tag in the jsp is used to define the error page

  1. None of the above
  2. location
  3. exception-type
  4. error-page
Question 13 Multiple Choice (Single Answer)

Which of the tag is used to show the comments in the JSP page

  1. <% code fragment %>
  2. <%= expressions %>
  3. <%! Declarations %>
  4. <%-- comment -- %>
Question 14 Multiple Choice (Single Answer)

Which codeline must be set before any of the lines that use the PrintWriter

  1. setContentWriter()
  2. setWriter()
  3. setPrintType()
  4. setContentType()
Question 15 Multiple Choice (Single Answer)

Implementing the tag < %@ page isThreadSafe="false" % >implements the SingleThreadModel interface making the Jsp

  1. None of the above
  2. content safe
  3. synchornised
  4. thread safe
Question 16 Multiple Choice (Single Answer)

The error message displayed when the page is not found at the correct location

  1. 550
  2. 440
  3. 505
  4. 404
Question 17 True/False

The jsp:plugin tag is used to insert the browser-specific OBJECTS and EMBED elements

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

Which of the following statement is true for the include directive Can be used to incorporate contents from static documents

  1. It offers option of sharing local variables and better run time efficiency
  2. Provides benefit of automatic recompilation
  3. It is processed during translation and compilation and does not impose any restrictions on output buffering
  4. none of the above
Question 19 Multiple Choice (Multiple Answers)

Which of the following statement is true for the tag

  1. It offers option of sharing local variables and better run time efficiency
  2. Can be used to incorporate contents from static documents
  3. Provides benefit of automatic recompilation
  4. Can include dynamically generated output
Question 20 True/False

State true or false :- URL instance represents the location of a resource

  1. True
  2. False