Introduction to Servlet Request and Response
This Test will cover the Servlet request and response mechanism, HttpServletRequest, HttpServletResponse, how request and response comes and goes out of scope etc.
Q. Which of these classes define the getWriter() method that returns an object of type PrintWriter ? Select the one correct answer. ?
Q.Which method defined in the HttpServletResponse may be used to set the content type ?
Q. Which method of HttpServletResponse is used to redirect an HTTP request to another URL ?
Q. Given request is a HttpServletRequest object, which gets a binary input stream ?
Q. Which method defined in the HttpServletRequest returns the object of RequestDispatcher ?
Q. Which statement is true about include() method of RequestDispatcher interface ?
Which method of HttpServletRequest returns the name of the HTTP method with which the request was made ?
Q. When the Web Container initializes a servlet, it creates a ___________ object for the servlet ?
Q) ____________ object is available to any servlet or JSPs that are part of the web app and provides communication between servlets and JSPs.
Q. Which types of objects can store attributes ?