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

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 - 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 attributes are mandatory in <jsp:useBean /> tag?

A - id, type

B - id, class

C - type, class

D - type,property

Answer : B

Explaination

The 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 using class.

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.

Answer : C

Explaination

The pageContext object is an instance of a javax.servlet.jsp.PageContext object. The pageContext object is used to represent the entire JSP page.

Answer : B

Explaination

The extends attribute specifies a superclass that the generated servlet must extend.

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

Explaination

When a container loads a JSP it invokes the jspInit() method before servicing any requests.

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
E-Books Store