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 - This object can be used to access other implicit objects in JSP.

A - request

B - page

C - context

D - pageContext

Answer : D

Explaination

pageContext can be used to retrieve other implicit objects using its methods like getPage(), getRequest() etc.

Q 4 - Which of the following attribute is used to mark a page as error processing page?

A - isErrorPage

B - errorPage

C - exception

D - exceptionPage

Answer : A

Explaination

<%@ page isErrorPage="true" %>

Within jsp, indicate that it is an error-processing page, using the above 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 autoFlush attribute specifies whether buffered output should be flushed automatically when the buffer is filled, or whether an exception should be raised to indicate buffer overflow.

Answer : A

Explaination

If the attribute is set to false, then expressions are not evaluated but rather treated as static text.

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

Explaination

JSTL, JavaServer Pages Standard Tag Library is a collection of useful JSP tags which encapsulates core functionality common to many JSP applications.

Answer : B

Explaination

The <c:if> tag evaluates an expression and displays its body content only if the expression evaluates to true.

jsp_questions_answers.htm
Advertisements