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

Explaination

Correct Signature is void jspInit()

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.

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.

Answer : A

Explaination

The application object is direct wrapper around the ServletContext object for the generated Servlet and in reality an instance of a javax.servlet.ServletContext object.

Answer : A

Explaination

When buffer is set to "none", servlet output is immediately directed to the response output object.

Answer : A

Explaination

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

Answer : C

Explaination

The getProperty action is used to retrieve the value of a given property and converts it to a string, and finally inserts it into the output.

Answer : C

Explaination

sendRedirect sends HTTP temporary redirect response to the browser, and browser creates a new request to go the redirected page.

Answer : A

Explaination

JavaBeans and taglib fundamentals were introduced for reusability. But following are the major differences between them −

  • Taglibs are for generating presentation elements while JavaBeans are good for storing information and state.

  • Use custom tags to implement actions and JavaBeans to present information.

jsp_questions_answers.htm
Advertisements