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

Q 3 - Which of the following attributes are mandatory in <jsp:useBean /> tag?

A - id, type

B - id, class

C - type, class

D - type,property

Answer : B

Explaination

The useBean action first searches for an existing object utilizing the id and scope variables. If an object is not found, it then tries to create the specified object using class.

Q 4 - Which of the following is an implicit object?

A - pageContext

B - servletContext

C - httpContext

D - sessionContext

Answer : A

Explaination

pageContext is an implicit object.

Answer : C

Explaination

JSP Filters are Java classes that can be used in JSP Programming for both of the above purposes.

Answer : A

Explaination

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

Answer : A

Explaination

The info attribute lets you provide a description of the JSP.

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.

Q 9 - Is JSP technology extensible?

A - true

B - false

Answer : A

Explaination

Yes. JSP technology is extensible through the development of custom actions, or tags, which are encapsulated in tag libraries.

Answer : C

Explaination

The <c:url> tag formats a URL into a string and stores it into a variable. This tag automatically performs URL rewriting when necessary.

jsp_questions_answers.htm
Advertisements