Posted by: swanky Posted on: 2003-11-16 17:17
QUESTION NO: 142 You are developing a Web application to provide inventory management for a wine store. The application will require an Inventory class, to manage the whole store inventory, and an InventoryItems class, to represent the specific information about an item in the inventory. The InventoryItem class has the following goals: - The information in an InventoryItem object is immutable. - The inventory data is stored in a remote server. - The InventoryItem will be referenced multiple times in the same JSP.
Which design pattern matches the goals of the InventoryItem class? A. Facade B. Value Object C. Front Component D. Model-View-Controller -- QUESTION NO: 143 Which J2EE design pattern unifies and simplifies workflow by interpreting user request and dispatching screen from a single point? A. Value Object B. Front Component C. Data Access Object D. Model-View-Controller E. Session Entity Facade -- QUESTION NO: 144 As a programmer at Yoshi Inc you are developing a Web application that must load information from several different sources, including databases and XML files. Which design pattern is intended to support this functionality? A. Value Object B. Front Component C. Template Method D. Data Access Object -- QUESTION NO: 145 Which J2EE design pattern provides flexible, extensible access to data and other resources? A. Value Object B. Front Component C. Data Access Object D. Bimodal Data Access E. Session Entity Facade -- QUESTION NO: 146 Given this code from the doGet method, where response is an HttpServletResponse: 12. response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY); 13. response.setHeader("Location", "http://www.yoshi.com"); Which is equivalent? A. response.forward("http://www.yoshi.com"); B. response.include("http://www.yoshi.com"); C. response.redirect("http://www.yoshi.com"); D. response.setLocation("http://www.yoshi.com"); E. response.sendRedirect("http://www.yoshi.com"); -- QUESTION NO: 147 Given: 1. public class ServletYoshi extends HttpServlet { 2. public void doGet(HttpServletRequest request, 3. HttpServletResponse response) 4. throws ServletException, IOException 5. { 6. try { 7. Integer.parseInt("one"); 8. } catch(Exception e) { 9. String message = "Caught exception"; 10. 11. } 12. } 13. } Which two, inserted individually at line 10, will place a descriptive message and the stack trace of the caught exception in the servlet log file? (Choose two) A. log(message, e); B. request.log(message, e); C. getServletInfo().log(message, e); D. getServletConfig().log(message, e); E. getServletContext().log(message, e); F. request.getSession().log(message, e); -- QUESTION NO: 148 Which two represent valid JSP expressions? (Choose two) A. <% x %> B. <%= Math.random() %> C. <%= "YOSHI" + "EXAMINATOR" %> D. <%= Math.random(); %> E. <% int x = "4" + "2"; %> F. <% String x = "4" + "2" %> -- QUESTION NO: 149 Which event is received by the appropriate listeners when a servlet context is first created? A. javax.servlet.ServletContextEvent B. javax.servlet.ServletCreatedEvent C. javax.servlet.ServletInitializedEvent D. javax.servlet.http.HttpServletContextEvent E. javax.servlet.http.HttpServletInitializedEvent -- QUESTION NO: 150 Within a Web application deployment descriptor, which specifies an HttpSessionActivationListener implemented by the class wcd.http.ActivationListener? A. <listener> wcd.http.ActivationListener </listener> B. <listener> <class>wcd.http.ActavationListener</class> </listener> C. <attr-listener> <class>wcd.http.ActivationListener</class> </attr-listener> D. <listener> <listener-class> wcd.http.ActicationListener </listener-class> </listener> E. <session-listener> <listener-class> wcd.http.ActivationListener </listener-class> </session-listener> |