JSP Online Quiz


Advertisements


Following quiz provides Multiple Choice Questions (MCQs) related to JSP Fundamentals. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Questions and Answers

Q 1 - jspInit() method of HttpJspPage class can be overridden.

A - True

B - False

Answer : A

Explaination

Yes, jspInit() method can be overridden.

Q 2 - If a jsp is to generate a xml page, what attribute of page directive it should use?

A - contentXML

B - generateXML

C - typeXML

D - contentType

Answer : D

Explaination

<%page contentType="text/xml">

Q 3 - Which of the following do not supports JSP directly?

A - Weblogic Server

B - WebSphere Server

C - Tomcat Server

D - Apache HTTP Server

Answer : D

Explaination

Apache HTTP Server do not supports JSP directly.

Answer : A

Explaination

The application object is direct wrapper around the ServletContext object for the generated Servlet and in reality an instance of a javax.servlet.ServletContext object.

Q 7 - What is the default value of isELIgnored attribute?

A - true

B - false

Answer : A

Explaination

The default value of isELIgnored attribute is true, meaning that expressions, ${...}, are evaluated as dictated by the JSP specification.

Q 8 - Which of the following step is taken by JSP container during Compilation phase?

A - Parsing the JSP.

B - Turning the JSP into a servlet.

C - Compiling the servlet.

D - All of the above.

Answer : C

Explaination

The compilation process involves three steps: a) Parsing the JSP, b) Turning the JSP into a servlet, c) Compiling the servlet.

Answer : C

Explaination

sendRedirect sends HTTP temporary redirect response to the browser, and browser creates a new request to go the redirected page.

Answer : A

Explaination

The <c:catch> tag catches any Throwable that occurs in its body and optionally exposes it. Simply it is used for error handling and to deal more gracefully with the problem.


jsp_questions_answers.htm

Advertisements