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 a server side technology?

A - html

B - jsp

C - javaScript

D - css

Answer : B

Explaination

jsp is a server side technology.

Q 3 - Which of the following do not supports JSP directly?

A - Weblogic Server

B - WebSphere Server

C - Tomcat Server

D - Apache HTTP Server

Answer : D

Explaination

Apache HTTP Server do not supports JSP directly.

Q 4 - Which of the following attribute is used to have uncaught run-time exceptions automatically forwarded to an error processing page?

A - error

B - errorPage

C - exception

D - exceptionPage

Answer : B

Explaination

<%@ page errorPage="error.jsp" %>

It will redirect the browser to the JSP page error.jsp if an uncaught exception is encountered during request processing.

Answer : C

Explaination

JSP Filters are Java classes that can be used in JSP Programming for both of the above purposes.

Answer : A

Explaination

A translation-time error will be raised if the JSP uses any scriptlets, expressions (non-EL), or declarations.

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.

Q 9 - Can a JSP page process HTML FORM data?

A - true

B - false

Answer : A

Explaination

Yes. However, unlike Servlet, you are not required to implement HTTP-protocol specific methods like doGet() or doPost() within your JSP page. You can obtain the data for the FORM input elements via the request implicit object within a scriptlet or expression.

Answer : C

Explaination

The <c:param> tag allows proper URL request parameter to be specified with URL and it does any necessary URL encoding required.

jsp_questions_answers.htm
Advertisements