Mvc pattern and servlet
Course:- JAVA Programming
Reference No.:- EM131488

Assignment Help
Assignment Help >> JAVA Programming

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 use the forward method of

A. the request object

B. the ServletContext object

C. the response object

D. a RequestDispatcher object

Question 3

The following Anchor tag demonstrates how to use < a href="/WorkServlet?shift=< %= shiftCode % > " > View your schedule
< /a>

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 following is not a benefit of using the MVC pattern for an application?

A. it requires less code

B. JSPs are used for what they do best

C. it's easier to make changes to the application servlets are used for what they do best JSPs are used for what they do best

D. it's easier to make changes to the application servlets are used for what they do best JSPs are used for what they do best it's easier to test and debug the application

Question 6

Which of the following 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 following code from a web.xml file, the error.htm page is called when < error-page>

< exception-type>java.lang.Throwable< /exception-type>
< location>error.htm< /location>
< /error-page>

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 following JSP tag is coded in a main JSP, what happens when the reports.jsp page is updated?
< jsp:include page="includes/reports.jsp" />

A. the changes aren't updated in the subsequent requests for the main JSP

B. the changes appear for subsequent requests for the main JSP

C. a JSP error is thrown

Question 9

A 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

When you use hidden fields to pass parameters to a servlet or JSP, all but one of the following is true. Which one is it?

A. the parameters aren't shown in the URL

B. the user can see the parameters by using the browser to look at the page's source code

C. you don't have to store the parameters in the session object

D. you can't use URL encoding

Ask Question & Get Answers from Experts
Browse some more (JAVA Programming) Materials
Write a complete java program Assuming that the variables gpa, deanList and studentName have been declared, you should read in the studentName and gpa from keyboard. Write an
Programming Exercises 1. Write an application named BadSubscriptCaught in which you declare an array of 10 first names. Write a try block in which you prompt the user for an i
You will create a secure Parts Inventory Catalog system using Model 2 architecture. The application will require a user to have the proper access right to enter the system,
Write an application that displays every perfect number from 1 through 1000. A perfect number is one that equals the sum of all the numbers that divide evenly into it.
THE JAVA SOURCE CODEA company hires you to write a program to track hourly employee arrival and departure times from work. In essence, you are tasked to make an online time cl
Write a Java program (a collection of Java classes) including a class named ExpressionCalculator that contains a static main method. This main method will prompt the user to
Write an interface for a BagADT that implements the Iterable interface. Include javadoc comments that will generate specifications for the BagADT so that someone who wants
Given a hash function h, prepare a java simulation program to determine each of the subsequent quantities after 0.8*tablesize random keys have been generated. The keys shoul
Write down the java program which will read the line of text which ends with the period, which serves as sentinel value. Show all the letters which occur in the text.
After being given a collection of scores (type int) for the last exam in your computer course, you are to computer the average of the scores and assign grades (O, S, U i.e. Ou
Driveway is a "last-in, first-out" stack. Of course, when a car owner retrieves a vehicle that wasn't the last one in, the cars blocking it must temporarily move to the stre
Java TV's newest owner! Java TV is the greatest TV channel ever, and it prides itself in its 24 hour interesting ' programming'. To help you run this channel you will need to