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 - Setting isThreadSafe false can lead to poor performance.

A - True

B - False

Answer : A

Explaination

If you set the isThreadSafe option to false, the JSP engine makes sure that only one thread at a time is executing your JSP.

Q 3 - All servlet classes are required to be mapped and configured in web.xml.

A - True

B - False

Answer : A

Explaination

Yes, all servlets are required to be mapped/configured in web.xml

Q 5 - Which of the following method can be used to read a form parameter in JSP?

A - request.getParameter()

B - response.getParameter()

C - request.getValue()

D - response.getValue()

Answer : A

Explaination

You call request.getParameter() method to get the value of a form parameter.

Answer : A

Explaination

A value of true (default) indicates automatic buffer flushing and a value of false throws an exception.

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

A - true

B - false

Answer : A

Explaination

The default value (true) of isScriptingEnabled attribute enables scriptlets, expressions, and declarations.

Answer : A

Explaination

Compilation, Initialization, Execution, Cleanup is the correct order.

Answer : A

Explaination

Using <%jsp:param> tag you can pass information from JSP to included JSP.

Answer : C

Explaination

The <c:forEach > tag exists as a good alternative to embedding a Java for, while, or do-while loop via a scriptlet.


jsp_questions_answers.htm

Advertisements