Top 50+ Solved JSP MCQ Questions Answer
Q. Which one is the correct order of phases in JSP life cycle?
a. Initialization, Cleanup, Compilation, Execution
b. Initialization, Compilation, Cleanup, Execution
c. Compilation, Initialization, Execution, Cleanup
d. Cleanup, Compilation, Initialization, Execution
Q. Which technology do we mix our business logic with the presentation logic?
a. Servlet
b. JSP
c. Both A and B
d. None of the above
Q. Which attribute specifies a JSP page that should process any exceptions thrown but not caught in the current page?
a. The ErrorPage Attribute
b. The IsErrorPage Attribute
c. Both A & B
d. None of the above
Q. Which of the following is an advantage of the statement – Separation of business logicfrom JSP ?
a. Custom Tags in JSP
b. JSP Standard Tag Library
c. All the above
d. None of the above
Q. JSPs eventually are compiled into Java servlets, you can do as much with JSPs as you cando with Java servlets.
a. True
b. False
c. none
d. all
Q. JavaServer Pages often serve the same purpose as programs implemented using theCommon Gateway Interface (CGI)
a. True
b. False
c. none
d. all
Q. Which is the Microsoft solution for providing dynamic Web content?
a. ASP
b. JSP
c. Both A and B
d. None of the above
Q. Which tag is used to execute java source code in JSP?
a. Declaration Tag
b. Scriptlet tag
c. Expression tag
d. None of the above
Q. Which packages does a JSP API consist of?
a. javax.servlet.jsp
b. java.servlet
c. javax.servlet.jsp.tagext
d. Both A & C
Q. Which of the scripting of JSP not putting content into service method of the convertedservlet?
a. Declarations
b. Scriptlets
c. Expressions
d. None of the above
Q. The difference between Servlets and JSP is the …………….
a. translation
b. compilation
c. syntax
d. Both A and B
Q. Which of the following are the valid scopes in JSP?
a. request, page, session, application
b. request, page, session, global
c. response, page, session, application
d. request, page, context, application
Q. JSP includes a mechanism for defining …………………………. or custom tags.
a. static attributes
b. local attributes
c. dynamic attributes
d. global attributes