0% found this document useful (0 votes)
270 views6 pages

JSP MCQ

This document contains 30 multiple choice questions about Java Server Pages (JSP) technology. It tests knowledge on topics like: - What JSP stands for - The definition and purpose of JSP - Common JSP tags, directives, and syntax - The JSP lifecycle and how JSP pages are compiled into servlets - The advantages of using JSP - Important Java classes and packages used in JSP

Uploaded by

sagar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
270 views6 pages

JSP MCQ

This document contains 30 multiple choice questions about Java Server Pages (JSP) technology. It tests knowledge on topics like: - What JSP stands for - The definition and purpose of JSP - Common JSP tags, directives, and syntax - The JSP lifecycle and how JSP pages are compiled into servlets - The advantages of using JSP - Important Java classes and packages used in JSP

Uploaded by

sagar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

By InterviewMocks.

com
JSP MCQ Quiz

Q1. JSP stands for ___.

A. Java Server Pages


B. Java Side Pages
C. Java Server Phase
D. All of the above

Q2. What is JSP?

A. Java Server Pages (JSP) is a server-side programming technology that enables the creation of
dynamic, platform-independent method for building Web-based applications.
B. Java Server Pages (JSP) is a client-side programming technology that enables the creation of
dynamic, platform-independent method for building Web-based applications.
C. Both A and B
D. None of the above

Q3. Which of the following is the correct syntax to declare comments in JSP?

A. <%-- This is JSP comment --%>


B. <!-- This is JSP comment -->
C. //..
D. All of the above

Q4. Which of the following is not a directive?

A. include
B. page
C. export
D. useBean

Q5. Which technology do we mix our business logic with the presentation logic?

A. Servlet
B. JSP
C. Both A & B
D. None of the above
Q6. Which JSP Action tags is used to include the content of another resource, it may be
JSP, html or Servlet?

A. <jsp:include >
B. <jsp:forward >
C. <jsp:plugin >
D. <jsp:papam >

Q7. A JSP page consists of which tags?

A. HTML tags
B. JSP tags
C. Both A & B
D. None of the above

Q8. Which packages does a JSP API consist of?

A. javax.servlet.jsp
B. java.servlet
C. javax.servlet.jsp.tagext
D. Both A & C

Q9. JDBC stands for __.

A. Java Database Connectivity


B. Jar Database Connectivity
C. Java Database Content
D. None of the above

Q10. Is JSP technology extensible?

A. True
B. False

Q11. Which of the following is true about <c:redirect> tag?

A. The <c:redirect > tag redirects the browser to an alternate URL by providing automatically URL
rewriting.
B. The <c:redirect > tag supports context-relative URLs.
C. The <c:redirect > tag supports <c:param> tag.
D. All of the above
Q12. What are the advantages of JSP?

A. platform independent
B. good performance and scalability
C. easily maintained
D. All of the above

Q13. What is the use of <c:catch> tag?

A. to catch any Throwable that occurs in its body and optionally exposes it.
B. to catch the runtime error and redirect to error page.
C. Both of the above.
D. None of the above.

Q14. Compilation process of JSP page involves:

A. Parsing of JSP
B. Turning JSP into servlet
C. Compiling the servlet
D. All of the above

Q15. What is the use of <c:remove > tag?

A. It removes a item from a list


B. It removes the data row from the database.
C. It removes a variable from either a specified scope or the first scope where the variable is
found.
D. None of the above

Q16. What is the synatx of JSP Page directive?

A. <%@ page…%>
B. <% page…%>
C. <!@ page…!>
D. None of the above

Q17. Which syntax is used to defines the programming language (underlying language)
being used in the JSP?

A. <%@ page language="value" %>


B. <!@ page language="value" !>
C. <@ page language="value" >
D. None of the above

Q18. What JSTL stands for?

A. JSP Tag Library


B. JavaServer Pages Standard Tag Library
C. Java Standard Tag Library
D. None of the above.

Q19. A __ is used to insert the value of a scripting language expression, converted into
a string, into the data stream returned to the client.

A. JSP expression
B. ASP
C. PHP
D. None of the above

Q20. Which of the following is true about <jsp:useBean> action?

A. 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.
B. useBean is used to load java beans in jsp page.
C. Both of the above.
D. None of the above

Q21. Which one of the following is a syntax to create a simple JSP?

A. <html> <body> <% out.print(2*5); %> </body> </html>


B. <html> <body> <! out.print(2*5); !> </body> </html>
C. <html> <body> <%@ out.print(2*5); %> </body> </html>
D. None of the above

Q22. Application is instance of which class?

A. javax.servlet.HttpContext
B. javax.servlet.ServletContext
C. javax.servlet.Context
D. javax.servlet.Application

Q23. Which tag should be used to pass information from JSP to included JSP?

A. Using <%jsp:param> tag


B. Using <%jsp:page> tag
C. Using <%jsp:useBean> tag
D. Using <%jsp:import> tag

Q24. Which option is true about session scope?

A. Objects are accessible only from the pages which are processing the same request
B. Objects are accessible only from the pages which reside in same application
C. Objects are accessible only from the page in which they are created
D. Objects are accessible only from the pages which are in same session

Q25. Default value of autoFlush attribute is?

A. True
B. False

Q26. Which one is the correct order of phases in JSP life cycle?

A. Compilation, Initialization, Execution, Cleanup


B. Cleanup, Compilation, Initialization, Execution
C. Initialization, Cleanup, Compilation, Execution
D. Initialization, Compilation, Cleanup, Execution

Q27. Request is instance of which one of the following classes in jsp:

A. ServletRequest
B. HttpServletRequest
C. Request
D. HttpRequest

Q28. Which is mandatory in <jsp:useBean /> tag?

A. id, type
B. type, property
C. type,id
D. id, class

Q29. The difference between Servlets and JSP is:

A. compilation
B. translation
C. Both A and B
D. syntax

Q30. Which of the scripting of JSP not putting content into service method of the
converted servlet?

A. Declarations
B. Expressions
C. Scriptlets
D. All of the above

Please Visit interviewmocks.com to download more pdfs

You might also like