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

Answer : B

Explaination

Correct Signature is

void _jspService(HTTPRequest request, HTTPResponse response) throws ServletException, IOException

Q 2 - Which of the following is not a directive?

A - include

B - page

C - export

D - useBean

Answer : C

Explaination

export is not a page directive.

Q 3 - All jsp pages are required to be mapped and configured in web.xml.

A - True

B - False

Answer : B

Explaination

No, Jsp pages are not required to be mapped/configured in web.xml

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

Q 6 - What is default value of autoFlush Attribute?

A - true

B - false

Answer : A

Explaination

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

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

A - true

B - false

Answer : A

Explaination

The default value (true) of isScriptingEnabled attribute enables scriptlets, expressions, and declarations.

Answer : D

Explaination

Whenever a browser requests a JSP and the page has been loaded and initialized, the JSP engine invokes the _jspService() method in the JSP.The _jspService() method of a JSP is invoked once per a request and is responsible for generating the response for that request and this method is also responsible for generating responses to all seven of the HTTP methods ie. GET, POST, DELETE etc.

Answer : B

Explaination

Internationalization means enabling a web site to provide different versions of content translated into the visitor's language or nationality.

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