JSP Online Quiz


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

Answer : B

Explaination

Correct Signature is

void _jspService(HTTPRequest request, HTTPResponse response) throws ServletException, IOException

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

A - contentType

B - generatePdf

C - typePDF

B - contentPDF

Answer : A

Explaination

<%page contentType="application/pdf">

Above tag is used to generate PDF using JSP.

Answer : A

Explaination

The out implicit object is an instance of a javax.servlet.jsp.JspWriter object and is used to send content in a response.

Answer : B

Explaination

The extends attribute specifies a superclass that the generated servlet must extend.

Answer : A

Explaination

A translation-time error will be raised if the JSP uses any scriptlets, expressions (non-EL), or declarations.

Answer : C

Explaination

The destruction phase of the JSP life cycle represents when a JSP is being removed from use by a container.The jspDestroy() method is the JSP equivalent of the destroy method for servlets.

Answer : B

Explaination

Internationalization means enabling a web site to provide different versions of content translated into the visitor's language or nationality.

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