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 - jspInit() method of HttpJspPage class can be overridden.

A - True

B - False

Answer : A

Explaination

Yes, jspInit() method can 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.

Answer : D

Explaination

JSP stands for Java Server Pages.

Q 4 - isErrorPage is by default true.

A - True

B - False

Answer : B

Explaination

isErrorPage is required to be set true, it is false by default.

Q 5 - Which of the following method can be used to read parameters names?

A - request.getParameter()

B - response.getParameter()

C - request.getParameterNames()

D - response.getParameterNames()

Answer : C

Explaination

You call request.getParameterNames() method to get the names of all the parameters passed.

Answer : B

Explaination

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

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 forward action terminates the action of the current page and forwards the request to another resource such as a static page, another JSP page, or a Java Servlet.

Answer : C

Explaination

Localization means adding resources to a web site to adapt it to a particular geographical or cultural region for example Hindi translation to a web site.

Answer : C

Explaination

The <c:param> tag allows proper URL request parameter to be specified with URL and it does any necessary URL encoding required.


jsp_questions_answers.htm

Advertisements