Paper Tayyari

Lecture 30: Dispatching Requests

MCQs, short and long questions from lecture 30.Lecture 30 ki MCQs, short aur long sawal.

6 MCQs · 8 short · 3 long questions · 6 MCQs from past papers6 MCQs · 8 short · 3 long sawal · 6 MCQs past papers se

Start mock testMock test shuru karein
DoneHal kiye 0/6
– correctsahi
1.
★ Final term Spring 2010

By using forward() method of _________ object, the called resource will be able to access the original request object.

  1. AHttpServletRequest
  2. BHttpServletResponse
  3. CRequestDispatcher
  4. DServletConfig

RequestDispatcher.forward() passes the same request object to the called resource.

2.
★ Final term 2012

Why we use RequestDispatcher to forward a request to another resource(servlet, html, jsp), instead of using a sendRedirect()?

  1. AsendRedirect() is not supported in servlet API.
  2. BRequestDispatcher is not supported in servlet API.
  3. CRequestDispatcher is efficient and allows the server to maintain request status.
  4. DNone of these

Forwarding needs no round trip to the client and keeps the same request object.

3.
★ Final term past paper

By using sendRedirect() method of ________ object, a new request is generated which redirects the user to called resource.

  1. AServletConfig
  2. BServletContext
  3. CHttpServletRequest
  4. DHttpServletResponse

sendRedirect() is a method of HttpServletResponse.

4.
★ Final term past paper

By ________, the original request can be forwarded to the next servlet.

  1. Aboth request dispatching and response redirection
  2. BNone of the given options
  3. Crequest dispatching
  4. Dresponse redirection

RequestDispatcher.forward() passes the same request on; sendRedirect() makes the browser send a new one.

5.
★ Final term past paper

Which one of the following is not a request dispatching method?

  1. Aforward( )
  2. Binclude( )
  3. CBoth forward( ) and include( )
  4. DNone of the given options

forward() and include() are both RequestDispatcher methods, so none of the options is excluded.

6.
★ Final term past paper

In which of the following format does the key in request Dispatching is stored?

  1. AInteger
  2. BDouble
  3. CString
  4. DChar

request.setAttribute(String name, Object value) stores the attribute under a String key.