JSP and Servlets Fundamentals
Test your knowledge of Java Server Pages (JSP) and Servlet technologies including syntax, scopes, life cycle, and server configuration.
Questions
A servlet can handle multiple requests concurrently.
- True
- False
Through a ServletContext object, servlets can interact with their enviornment.
- True
- False
. To get an object of PrintWriter, we use getWriter() method of class _____________
- HttpSession
- HttpServletResponse
- HttpServletRequest
- none
A life-cycle method of a servlet is_________________
- init()
- service()
- destroy()
- Above All
Number of ServletContext object present for an application is __________
- 2
- 1
- not fixed
- 3
The method used for fetching object in the request object is __________
- getAttribute()
- getParameter()
- getInitParameter()
- none
Servlets are multi threaded
- True
- False
In the init(ServletConfig) method of Servlet life cycle, what method can be used to access the ServletConfig object ?
- getServletInfo()
- getInitParameters()
- getServletConfig()
- none
Which of the following is server side programming languages? 1 HTML 2 JavaScript 3 JSP 4 Sevlets
- 1,2,3,4
- 1,2
- 3,4
- none
What JSP stand for
- Java Server Pages
- Java Server Programming
- Java Service Pages
- Java Service Programming
What JSP is basically used today
- To make controller
- To make GUI
- In writing business logic
- Deprecated
- none
We must have configure and map all jsp files into web.xml
- True
- False
JSP can run by
- Apache Tomact
- Bea WebLogic
- Servlets
- JSP Engine
IBM WebSphere is?
- A full-featured Web Application Server
- It provides supports to the Servlet and JSP
- . It includes pooled database access for DB2 and Oracle Relational Databases
- Provide support for EJB .
Syntax of Scriptlet Element
- <% code %>
- <@jsp code %>
- <jsp: scriptlet code />
- <%jsp code %>
Syntax of Declaration Element
- <%! code !%>
- <%! code %>
- <jsp: scriptlet code />
- <%jsp code !%>
JSP Syntax of comments
- <%-- comment --%>
- <!-- comment -->
- <% // comment %>
- <% /* comment */ %>
- <% /** comment */ %>
Choose correct scopes into JSP:-
- page, request, session, application
- Page, response, session, application
- Page, request, response, session
- None
Choose JavaBean Actions:-
- useBean
- setProperty
- getProperty
- All
- none
In jsp:useBean which two attributes is necessary
- id and scope
- class or beanName.
- type and id
- None