Forwarding a request to a servlet or jsp


Question 1: When you use the MVC pattern, the controller directs the flow of control to:

A) The browser and the model   
B) The view, model, and data store   
C) The view and the model    
D) The model and data store

Question 2: When you use the controller to forward a request to a servlet or JSP, you utilize the forward method of:

A) The request object   
B) The ServletContext object   
C) The response object   
D) A RequestDispatcher object

Question 3: The given Anchor tag demonstrates how to use

View your schedule

A) URL rewriting.   
B) Hidden fields.    
C) URL encoding.   
D) Cookies.

Question 4: Persistent cookies

A) Are removed after the session ends.   
B) Can’t be deleted.    
C) Exist after the session ends.   
D) Are often called hidden fields.

Question 5: Which of the given is not a benefit of using the MVC pattern for an application?

A) It needs less code    
B) JSPs are used for what they do best   
C) It is simpler to make changes to the application servlets are used for what they do best JSPs are used for what they do best   
D) It is simpler to make changes to the application servlets are used for what they do best JSPs are used for what they do best it is easier to test and debug the application

Question 6: Which of the given statements is invalid?

A) String name = session.getAttribute("fullName");    
B) session.setAttribute("fullName", "Ted Andrews");   
C) Book book = (Book) session.getAttribute("bookObj");    
D) session.removeAttribute("fullName")

Question 7: According to the given code from a web.xml file, the error.htm page is called when


java.lang.Throwable
error.htm

A) Any HTTP or Java error occurs.   
B) An uncaught exception is thrown.   
C) An HTML page can’t be found.   
D) An HTTP status code error occurs.

Question 8: If the given JSP tag is coded in a main JSP, what happens when the reports.jsp page is updated?

A) The changes are not updated in the subsequent requests for the main JSP    
B) The modifications appear for subsequent requests for the main JSP   
C) AJSP error is thrown.

Question 9: The session object is created

A) Every time a browser makes a request for a web page.   
B) Every time a browser requests a servlet.   
C) Every time a browser requests a jsp   
D) The first time a browser requests a servlet or JSP from a web site

Question 10: Whenever you use hidden fields to pass parameters to a servlet or JSP, all however one of the given is true. Which one is it?

A) The parameters are not shown in the URL    
B) The user can see the parameters by employing the browser to look at the page’s source code    
C) You do not have to store the parameters in the session object    
D) You cannot use URL encoding.    

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Forwarding a request to a servlet or jsp
Reference No:- TGS01222

Expected delivery within 24 Hours