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 - 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 - All servlet classes are required to be mapped and configured in web.xml.

A - True

B - False

Answer : A

Explaination

Yes, all servlets are required to be mapped/configured in web.xml

Q 5 - Which of the following method can be used to read a form parameter in JSP?

A - request.getParameter()

B - response.getParameter()

C - request.getValue()

D - response.getValue()

Answer : A

Explaination

You call request.getParameter() method to get the value of a form parameter.

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.

Answer : C

Explaination

The isScriptingEnabled attribute determines if scripting elements are allowed for use. The default value (true) enables scriptlets, expressions, and declarations. If the attribute's value is set to false, a translation-time error will be raised if the JSP uses any scriptlets, expressions (non-EL), or declarations.

Answer : C

Explaination

The setProperty action sets the properties of a Bean. The Bean must have been previously defined before this action.

Answer : C

Explaination

Locale is a particular cultural or geographical region. It is usually referred to as a language symbol followed by a country symbol which are separated by an underscore. For example "en_US" represents english locale for US.

Answer : D

Explaination

The <c:choose> works like a Java switch statement in that it lets you choose between a number of alternatives. Where the switch statement has case statements, the <c:choose> tag has <c:when> tags. A a switch statement has default clause to specify a default action and similar way <c:choose> has <otherwise> as default clause.

jsp_questions_answers.htm
Advertisements