Quiz PPAW
Quiz PPAW
Quiz PPAW
1. Suppose you want to know each time request comes in, so that you can log it. Which listener is
appropriate for that?
ServletRequestListener
2. If you want to know when a request attribute has removed, added or replace, then which listener is the
appropriate one?
ServletRequestAttributeListener
3. Which listener should use to find context has been created or destroyed?
ServletContextListener
4. How can we get context init parameter and run some code before rest of the application can service a
client?
ServletContextListener
Cookies
6. If you want to track active session or how many users are there? So which lsitener you should use.
HttpSessionListener
Session-IDs are usually stored in the cookies, URLs and hidden fields of Web pages.
8. You have an attribute class, and you want object of this type should be notified when they are bound to
or removed from a session. So which listener is appropriate one?
HttpSessionBindingListener
9. Which Listener you should use, when you want to know session attribute has added, removed or
replaced?
HttpSessionAttributeListener
ServletConfig
Quiz 2.
Cookies
It checks security
True
http/Https
Quiz 3.
1. The Web server that executes the servlet creates an ...... object and passes this to the servlet’s
service method (which, in turn, passes it to doGet() or doPost()).
HttpServletRequest
2. A get request gets information from a client. A post request posts data to a client.
False
3. Which of the following describe ways that dynamic information can be made available to a request
sent to an application
True
5. The client can access the servlet only if the servlet is installed on a ...... that can response servlet
requests.
Server
6. Java Networking Java 1.1 natively supports which of the following protocols:
Rasp: 1 only
http://www...../secureapp/do/Login?name=”bob”
Web.xml
Javax.servlet
Quiz 4.
Name/value
3. The servlet initialization parameters are specified in the ... deployment descriptor file as part of a
servlet element.
Web.xml
4. Which of the following identifies the correct method a servlet developer should use to retrieve form
data from the client provided to the doPost() method?
5. If you delete a field form a class and recompile the class, but then load an object that was seralised
before the new class was compiled what will happen?
The new object will contain all the data it used to including the removed field
6. Using relative paths to reference resources in the same context root makes your Web application
more flexible.
True
Attribute diagram
9. Java Threads Which of the following can you do with the synchronized keyword:
Synchronise on an object
10. Which of the following can be used to store client side user state information while avoiding any
impact due to the users web browser configuration?
HttpSessions