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 - _jspService() method of HttpJspPage class should not be overridden.

A - True

B - False

Answer : A

Explaination

JSP container creates _jspService() methods so it should not be overridden.

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 - 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.

Q 5 - Which of the following method can be used to read binary data stream coming from the client?

A - request.getInputStream()

B - response.getInputStream()

C - request.getInputStreamData()

D - response.getInputStreamData()

Answer : A

Explaination

You call request.getInputStream() method to read binary data stream coming from the client for example, image file uploaded.

Answer : C

Explaination

The isELIgnored option gives you the ability to disable the evaluation of Expression Language (EL) expressions. The default value of the attribute is true, meaning that expressions, ${...}, are evaluated as dictated by the JSP specification. If the attribute is set to false, then expressions are not evaluated but rather treated as static text.

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.

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.

Q 9 - Can you make use of a ServletOutputStream object from within a JSP page?

A - true

B - false

Answer : B

Explaination

No. You are supposed to make use of only a JSPWriter object (given to you in the form of the implicit object out) for replying to clients.

Answer : B

Explaination

The <c:if> tag evaluates an expression and displays its body content only if the expression evaluates to true.


jsp_questions_answers.htm

Advertisements