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 - Which of the following is not a implicit object?

A - request

B - response

C - cookie

D - session

Answer : C

Explaination

There is no cookie object in jsp.

Q 2 - session is instance of which class?

A - Session

B - HttpSession

C - HttpServletSession

D - ServletSession

Answer : B

Explaination

request is object of HttpSession.

Q 4 - Which of the following attribute is used to mark a page as error processing page?

A - isErrorPage

B - errorPage

C - exception

D - exceptionPage

Answer : A

Explaination

<%@ page isErrorPage="true" %>

Within jsp, indicate that it is an error-processing page, using the above directive.

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

Explaination

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

Answer : D

Explaination

The session attribute indicates whether or not the JSP page uses HTTP sessions. A value of true means that the JSP page has access to a builtin session object and a value of false means that the JSP page cannot access the builtin session object.

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.

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:forEach > tag exists as a good alternative to embedding a Java for, while, or do-while loop via a scriptlet.

jsp_questions_answers.htm
Advertisements