Wad(Web Site And A Web Application)

31 Questions | Total Attempts: 150

SettingsSettingsSettings
Website Quizzes & Trivia

Questions and Answers
  • 1. 
    1. What is the difference between a Web site and a Web application? 
    • A. 

      • Web sites typically use Apache, but Web applications use proprietary Web server applications.

    • B. 

      • Web applications provide a mechanism to allow the user to invoke programs running on the Web server

    • C. 

      • Sites with over 100 pages are called "Web applications."

    • D. 

      • There is no difference. The terms are synonymous.

  • 2. 
    2. What do you call the communication that is sent from the client to the server? What do you call the communication that is sent from the server back to the client? 
    • A. 

      • Input/Output

    • B. 

      • Send/Reply

    • C. 

      • Forward/Retrieve

    • D. 

      • Request/Response

  • 3. 
    3. What are two possible HTTP request types, and what are the names of the servlet methods that handle them? 
    • A. 

      • GET and POST, the doGet and doPost methods

    • B. 

      • SEND and RECEIVE, the service and init methods

    • C. 

      • GET and POST, the service and init methods

    • D. 

      • REQUEST and RESPONSE, the getRequest and setResponse methods

  • 4. 
    4. When using the Tomcat server as your Web server, which directory should your deployed simple servlet class file be in to be functional? 
    • A. 

      • /webapps/ROOT/WEB-INF/classes/package

    • B. 

      • /webappsIname-of-application/classes/package

    • C. 

      • /classes/ROOT/WEB-INF/pacicage

    • D. 

      • It does not matter in which directory it is deployed.

  • 5. 
    5. For an HTML form to send data successfully to a servlet, which two parameters must be specified in the form tag? 
    • A. 

      • The action attribute must specify the relative URL to the target servlet; the method attribute must specify GET or POST.

    • B. 

      • The action attribute must specify the relative URL to the target servlet; the name attribute must provide a unique name for the form.

    • C. 

      • The name attribute must provide a unique name for the form, the method attribute must specify the relative URL to the target servlet.

    • D. 

      • The action attribute must specify GET or POST, and the method attribute must specify the relative URL to the target servlet.

  • 6. 
    6. Which three attributes must be specified for each input tag in an HTML form? 
    • A. 

      • NAME, WIDTH, and VALUE

    • B. 

      • id, value, and type

    • C. 

      • NAME, TYPE, and VALUE

    • D. 

      • ACTION, METHOD, and VALUE

  • 7. 
    7.How is form data transmitted in the GET request?
    • A. 

      • Name-value pairs are sent in the header of the request after the URL.

    • B. 

      • Name-value pairs are sent in the body of the request.

    • C. 

      • In Hidden fields.

    • D. 

      • The complete HTML form, along with the user's responses, is sent after the URL.

  • 8. 
    8. Which object is created by the Web container so that each HTTP request can store the data from the request? 
    • A. 

      • A Servlet object

    • B. 

      • A ServletRequest object

    • C. 

      • An HttpServletRequest object

    • D. 

      • An HttpSession object

  • 9. 
    9. How can your servlet retrieve form data from a request? 
    • A. 

      • By using the getParameter method on the servlet

    • B. 

      • By using the getAttribute method of the HttpSession object

    • C. 

      • By using the getinitParameter method on the servlet

    • D. 

      • By using the getParameter method of the HttpServletRequest object

  • 10. 
    10. What methods are called by the Web container to control the life cycle of a servlet? 
    • A. 

      • The init, service, and destroy methods

    • B. 

      • The do Get and do Post methods

    • C. 

      • The doGet, doPost, and doDeiete methods

    • D. 

      • The start, init, and paint methods

  • 11. 
    11. Which of the servlet life cycle methods should you call to handle a request? 
    • A. 

      • The do Get or doPost methods

    • B. 

      • The init method

    • C. 

      • The service method

    • D. 

      • None

  • 12. 
    12. Which circumstance would be a good reason to override the servlet's init method?
    • A. 

      • When you need to start a servlet

    • B. 

      • When you want to initialize the state of that servlet with initialization parameters

    • C. 

      • You should always override the servlet's init method

    • D. 

      • You should never override the servlets init method

  • 13. 
    13. What is the name of the object that represents a Web application at runtime?
    • A. 

      • The ServletContext object.

    • B. 

      • The WebApplication object.

    • C. 

      • The ApplicationContext object.

    • D. 

      • There is no such object.

  • 14. 
    14. How does your servlet go about accessing the ServletContext object? 
    • A. 

      • Through the deployment descriptor.

    • B. 

      • With the getWebApp method.

    • C. 

      • It is always accessible because it is passed to the servlet in the doGet or doPost methods.

    • D. 

      • With the getServletContext method.

  • 15. 
    15. When a JSP page is translated, what is the result? 
    • A. 

      • A PHP page.

    • B. 

      • Java servlet code.

    • C. 

      • -An HTML page.

    • D. 

      • It does not get translated in the Web container. It is returned to the client and translated by the browser.

  • 16. 
    16. What immediately happens to the Java servlet code that was translated from the JSP page? 
    • A. 

      • It is compiled into a class file that is stored in the Web container.

    • B. 

      • The translated code is sent to the browser.

    • C. 

      • It is compiled into a class file that is sent to the browser.

    • D. 

      • It is compiled as an applet and then delivered to the client to run in its browser.

  • 17. 
    17. Which step must you complete to access the request object from a JSP page?
    • A. 

      • Call the getRequest method of the JSP page.

    • B. 

      • Use the getservietconfig method of the JSP page, then call the getRequest method of

    • C. 

      • the ServletConfig object.

    • D. 

      • There is never a good reason to access the request object from a JSP page.

    • E. 

      • None. It is an implicitly defined variable.

  • 18. 
    19. How are JavaBeans Components created?
    • A. 

      • The Web container creates a pool of them at startup time.

    • B. 

      • By a slow-roasting process that enhances the flavor and darkens the color

    • C. 

      • With the jsp:useBean standard action

    • D. 

      • By calling the j spGetBean method

  • 19. 
    18. Which important directive tag is used at the top of a JSP page to define properties for the entire page? 
    • A. 

      • The context directive.

    • B. 

      • The page directive.

    • C. 

      • The defineAii directive.

    • D. 

      • None. All such properties should be defined in the deployment descriptor.

  • 20. 
    20. How does one JSP page call another JSP page? 
    • A. 

      • With the j sp: forward standard action

    • B. 

      • With the j sp: request standard action

    • C. 

      • By calling the getRequest method from within a scriptlet tag

    • D. 

      • With the j sp: newPage standard action

  • 21. 
    21. In Model 1 architecture, JSP pages served as both the Controller and the View. What serves as the Controller in Model 2 architecture? 
    • A. 

      • JSP pages also serve as the controller in Model 2 architecture.

    • B. 

      • Data Access Objects.

    • C. 

      • Servlets.

    • D. 

      • The HttpServletRequest object.

  • 22. 
    22. In Model 2 architecture, which type of object is used to verify HTML form data and to store domain objects in the request? 
    • A. 

      • JSP pages.

    • B. 

      • Data Access Objects.

    • C. 

      • Servlets.

    • D. 

      • The HttpServletRequest object.

  • 23. 
    23. In Model 2 architecture, which type of object is used to render the user interface and to access the domain objects? 
    • A. 

      • JSP pages.

    • B. 

      • Data Access Objects.

    • C. 

      • Servlets.

    • D. 

      • The HttpServletRequest object.

  • 24. 
    24. How does the JSP page used for the View access the domain objects? 
    • A. 

      • In Model 2 architecture, JSP pages should not be accessing domain objects.

    • B. 

      • With the j sp: getBean standard action.

    • C. 

      • By mapping the JSP pages to the domain objects with the data-mapping tag in the deployment descriptor.

    • D. 

      • With the jsp: useBean standard action.

  • 25. 
    25. Enumerate at least 7 features usually existent in business systems? 
    • A. 

      • Remote method invocation

    • B. 

      • Concurrency

    • C. 

      • Load-balancing

    • D. 

      • Transparent fail-over

    • E. 

      • Back end integration

    • F. 

      • Dynamic redevelopment

    • G. 

      • Clean shutdown

    • H. 

      • Logging

Back to Top Back to top