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

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

Explaination

Filters are defined in the deployment descriptor file web.xml and then mapped to either servlet or JSP names or URL patterns in your application's deployment descriptor.

Answer : B

Explaination

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

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 - Is it possible to include files using absolute path in a JSP page using include directive?

A - true

B - false

Answer : A

Explaination

No! include directive takes relative URL with respect to current domain of web application.

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:remove > tag removes a variable from either a specified scope or the first scope where the variable is found (if no scope is specified).

jsp_questions_answers.htm
Advertisements