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

Answer : B

Explaination

Correct Signature is

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

Q 2 - If a jsp is to generate a pdf page, what attribute of page directive it should use?

A - contentType

B - generatePdf

C - typePDF

B - contentPDF

Answer : A

Explaination

<%page contentType="application/pdf">

Above tag is used to generate PDF using JSP.

Answer : D

Explaination

JSP stands for Java Server Pages.

Q 4 - Which of the following is an implicit object?

A - pageContext

B - servletContext

C - httpContext

D - sessionContext

Answer : A

Explaination

pageContext is an implicit object.

Q 5 - Which of the following method can be used to read a multiple values with same name, for example check box selections?

A - request.getParameter()

B - response.getParameter()

C - request.getParameterValues()

D - response.getParameterValues()

Answer : C

Explaination

You call request.getParameterValues() method to get the value of a form parameter if the parameter appears more than once and returns multiple values.

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

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