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

A - True

B - False

Answer : A

Explaination

Yes, jspDestroy() method can be overridden.

Q 2 - Which of the following is a server side technology?

A - html

B - jsp

C - javaScript

D - css

Answer : B

Explaination

jsp is a server side technology.

Q 3 - Which is the methods of generated Servlet?

A - jspInit()

B - _jspService()

C - jspDestroy()

D - All of the above

Answer : D

Explaination

All of the above methods get generated in generated servlet.

Q 4 - Which of the following attribute is used to have uncaught run-time exceptions automatically forwarded to an error processing page?

A - error

B - errorPage

C - exception

D - exceptionPage

Answer : B

Explaination

<%@ page errorPage="error.jsp" %>

It will redirect the browser to the JSP page error.jsp if an uncaught exception is encountered during request processing.

Answer : B

Explaination

The config object is an instantiation of javax.servlet.ServletConfig and is a direct wrapper around the ServletConfig object for the generated servlet.

Answer : C

Explaination

The import attribute serves the same function as, and behaves like, the Java import statement. The value for the import option is the name of the package you want to import.

Q 7 - What is the default value of isELIgnored attribute?

A - true

B - false

Answer : A

Explaination

The default value of isELIgnored attribute is true, meaning that expressions, ${...}, are evaluated as dictated by the JSP specification.

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