Read Also: Top 20 MCQ Questions on the JDBC Fundamentals
1. JSP uses server-side scripting that is actually translated into … and compiled before they are run.
A) Applet
B) Servlets
C) HTML
D) JavaScript
2. … are small programs that are downloaded into a Java Enabled Web Browser.
A) Applets
B) Servlets
C) HTML
D) JavaScript
3. State whether the following statements about the servlet are True or False.
i) Once a servlet is started it remains in memory and can handle multiple HTTP requests.
ii) Servlets do not run on the client, all execution takes place on the server.
iii) A servlet is limited by what the HTML specification supports.
A) i-True, ii-False, iii-True
B) i-True, ii-True, iii-False
C) i-False, ii-True, iii-True
D) i-True, ii-True, iii-True
4. In JSP, … are collectively called scripting elements.
i) Expressions
ii) Scriptlets
iii) Declarations
A) i and ii only
B) i and iii only
C) ii and iii only
D) All i, ii and iii
5. … elements used in JSP allow Java code to be embedded directly into the JSP page.
A) Directive
B) Declaration
C) Scriptlet
D) Action
6. … elements used in JSP allow Java code to be embedded directly into the JSP page.
A) Directive
B) Declaration
C) Scriptlet
D) Action
7. The purpose of a …. element is to initialize variables and methods and make them available to other declarations, scriptlets, and expressions.
A) directive
B) declaration
C) scriptlet
D) expression
8. State whether the following statements about the declaration element are True or False.
i) Declaration elements are effectively global.
ii) The syntax of the declaration element begins with the standard JSP open tag followed by a colon (<%:).
A) i-True, ii-False
B) i-True, ii-True
C) i-False, ii-True
D) i-False, ii-False
9. For incorporating Java code with HTML, we will use …
A) Action elements
B) Directive elements
C) Declarations elements
D) Scriptlets elements
10. Which of the following are the examples of implicit objects.
i) The in object
ii) The out object
iii) The request object
iv) The response object
A) i, ii and iii only
B) ii, iii and iv only
C) i, iii and iv only
D) All i, ii, iii and iv
11. The … is used to track information about a particular client while using stateless connection protocol such as HTTP.
A) config object
B) pageContext object
C) session object
D) application object
12. The … allows the JSP author access to the initialization parameters for the servlet or JSP engine.
A) config object
B) pageContext object
C) session object
D) application object
13. State whether the following statements about the implicit objects are True or False.
i) The response object deals with the stream of data back to the client.
ii) The response object is typically used by JSP page authors.
iii) The exception object is accessible only from an error page.
A) i-True, ii-False, iii-True
B) i-True, ii-True, iii-False
C) i-False, ii-True, iii-True
D) i-True, ii-True, iii-True
14. Which of the following are the features of custom tags used on the JSP.
i) It can access all the objects available to JSP pages.
ii) It can be customized via attributes passed from the calling page.
iii) It can be nested within one another.
A) i and ii only
B) i and iii only
C) ii and iii only
D) All i, ii and iii
15. … object is an instantiation of a javax.servlet.jsp.JspWriter object.
A) request
B) page
C) out
D) config
16. The … object is an instantiation of a java.lang.Throwable object.
A) application
B) page
C) session
D) exception
17. The … object is a representation of the JSP page through its entire lifecycle.
A) application
B) page
C) session
D) exception
18. … elements provide the information for the translation phase of the JSP page.
A) Directive
B) Declaration
C) Scriptlet
D) Action
19. The … element begins with the standard JSP start-tag followed by an equal sign (<%=).
A) directive
B) expression
C) scriptlet
D) declaration
20. State whether the following statements about the JSP scriptlets are True or False.
i) The Java code in scriptlets is executed when the user asks for the page.
ii) The JSP scriptlet is used for executing logic on the server-side.
A) i-True, ii-False
B) i-True, ii-True
C) i-False, ii-True
D) i-False, ii-False
Answers:
- B) Servlets
- A) Applets
- D) i-True, ii-True, iii-True
- D) All i, ii and iii
- C) Scriptlet
- A) Directive
- B) declaration
- A) i-True, ii-False
- D) Scriptlets elements
- B) ii, iii and iv only
- C) session object
- A) config object
- A) i-True, ii-False, iii-True
- D) All i, ii and iii
- C) out
- D) exception
- A) application
- D) Action
- B) expression
- B) i-True, ii-True