: JSP And Servlet
This is Java Programming Section of Multiple Choice Questions and answers on JSP and Servlet.
1. What are the mechanisms available in ServletContextListener interface?
Answer: B. contextInitialized((),contextDestroyed()
2. A deployment descriptor describes
Answer: B. web component settings
3. Dynamic interception of requests and responses to transform the information is done by
Answer: D. servlet filter
4. The life cycle of a servlet is managed by
Answer: B. servlet container
5. The include() method of RequestDispatcher
Answer: A. sends a request to another resource like servlet, jsp or html
6. The method forward(request,response) will
Answer: A. return back to the same method from where the forward was invoked
7. What is the limit of data to be passed from HTML when doGet() method is used?
8. The getSession() method with 'true' as its parameter [ getSession(true) ] it will return the appropriate session object when
Answer: D. the session is existing
9. Which of the following are the session tracking techniques?
Answer: B. URL rewriting, using session object, using cookies, using hidden fields
10. What's the difference between servlets and applets?
1.Servlets executes on Servers, where as Applets executes on Browser
2.Servlets have no GUI, where as an Applet has GUI
3.Servlets creates static web pages, where as Applets creates dynamic web pages
4.Servlets can handle only a single request, where as Applet can handle multiple requests
Answer: B. 1,2 are correct