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 : C

Explaination

Correct Signature is void jspInit()

Q 2 - if isThreadSafe attribute of page directive is set as true, then generated servlet implements SingleThreadModel interface.

A - True

B - False

Answer : B

Explaination

If isThreadSafe attribute of page directive is set as false, then generated servlet implements SingleThreadModel interface.

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

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 : C

Explaination

The autoFlush attribute specifies whether buffered output should be flushed automatically when the buffer is filled, or whether an exception should be raised to indicate buffer overflow.

Answer : C

Explaination

The include directive is used to includes a file during the translation phase. This directive tells the container to merge the content of other external files with the current JSP during the translation phase.

Answer : C

Explaination

The getProperty action is used to retrieve the value of a given property and converts it to a string, and finally inserts it into the output.

Answer : A

Explaination

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

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