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 - response is instance of which class?

A - Response

B - HttpResponse

C - HttpServletResponse

D - ServletResponse

Answer : C

Explaination

request is object of HttpServletResponse.

Q 2 - What is default value of isThreadSafe?

A - True

B - False

Answer : A

Explaination

The isThreadSafe option marks a page as being thread-safe. By default, it is true and all JSPs are considered thread-safe.

Answer : A

Explaination

The scope attribute identifies the lifecycle of the Action element. It has four possible values: (a) page, (b) request, (c) session, and (d) application.

Q 4 - Which of the following is not a jsp directive?

A - include

B - page

C - scriptlet

D - useBean

Answer : C

Explaination

scriptlet is not a jsp directive.

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

Explaination

The isELIgnored option gives you the ability to disable the evaluation of Expression Language (EL) expressions. The default value of the attribute is true, meaning that expressions, ${...}, are evaluated as dictated by the JSP specification. If the attribute is set to false, then expressions are not evaluated but rather treated as static text.

Answer : D

Explaination

The isThreadSafe option marks a page as being thread-safe. By default, all JSPs are considered thread-safe. If you set the isThreadSafe option to false, the JSP engine makes sure that only one thread at a time is executing your JSP.

Answer : C

Explaination

useBean action first searches for an existing object utilizing the id and scope variables. If an object is not found, it then tries to create the specified object. useBean is used to load java beans in jsp page.

Answer : A

Explaination

Using <%jsp:param> tag you can pass information from JSP to included JSP.

Answer : C

Explaination

The <c:url> tag formats a URL into a string and stores it into a variable. This tag automatically performs URL rewriting when necessary.

jsp_questions_answers.htm
Advertisements