1.Which of the following are TRUE with respect to the Servlet API?
A:Implementing the HttpSessionAttributeListener causes an object to be notified when it is bound to or unbound from a session.
B:A valid URI must be specified when obtaining a RequestDispatcher object.
C:HttpServletRequest objects provide methods to determine whether Cookies are being used for Session management.
D:HttpServletResponse objects provide methods for communicating objects between Servlets and JSPs.
Correct Answers: B, C
2.Referring to the Exhibit and assuming container-managed transactions, which of the following statements is TRUE concerning transactions and OrderBean?
![]() A: An invocation of an OrderBean method other than getTotal() outside a transaction will result in a new transaction being created.
B: An invocation of any OrderBean method outside a transaction will result in a new transaction being created.
C: An invocation of an OrderBean method other than getTotal() outside a transaction will result in a TransactionRequiredException.
D: An invocation of any OrderBean method outside a transaction will result in a TransactionRequiredException.
Correct Answers: A
3.Which of the following dependencies between J2EE modules within an EAR file are permitted?
A:A Web module may depend on classes from another Web module.
B:A Web module may depend on classes from an EJB module.
C:An EJB module may depend on classes from another EJB module.
D:An EJB module may depend on classes from a Web module.
Correct Answers: B, C
4.A developer is designing an architecture for a system that includes a large number of EJBs in the model layer. The client code is being developed by a large team of junior programmers. The developer wants to isolate the client team from much of the complexity of the EJBs. What is the BEST way to accomplish this goal?
A: Set up an interface control board, optimizing the recommended methods to use in the EJBs and publishing the results.
B: Set up mentoring between the EJB development team and the client team, ensuring the optimal use of the model layer services.
C: Use a session EJB to provide a smaller API for the clients. This Facade should be stateful.
D: Use a session EJB to provide a smaller API for the clients. This Facade should be stateless.
Correct Answers: D
5.A developer sets up a topic with a message-driven bean. During testing, the developer notes that messages are lost when a client disconnects. What possible changes will ensure that all unexpired messages are delivered when a client has been disconnected?
A:Use a queue instead of a topic.
B:Code the onMessage() method in the client code so that no acknowledgement is sent until after the messages have completed processing.
C:Specify <subscription-durability>Durable</subscription-durability> in the deployment descriptor for the topic.
D:Design the client code to implement the javax.jms.MessageListener interface.
Correct Answers: A, C
6.Which of the following code fragments show TYPICAL usage of a java.sql.Statement to retrieve values from a database table ?
A: statement.executeUpdate("SELECT NAME FROM STAFF WHERE ID = 10");
B: statement.executeUpdate("SELECT NAME FROM STAFF WHERE ID = ?",10);
C: statement.executeUpdate("DELETE FROM STAFF WHERE ID = 10");
D: statement.executeQuery("SELECT NAME FROM STAFF WHERE ID = 10");
E: statement.executeQuery("SELECT NAME FROM STAFF WHERE ID = ?",10);
F: statement.executeQuery("DELETE FROM STAFF WHERE ID = 10");
Correct Answers: D
7.A reference to an EJB can be stored by a client for later use by:
A: serializing the EJBObject to disk.
B: adding the object to the server's pooled objects.
C: implementing a find<method> method for the bean.
D: storing the Handle of the EJBObject.
Correct Answers: D
8.An EJB developer is assembling a set of beans for packaging in an EJB JAR file to sell. The Exhibit is a partial listing of the XML deployment descriptor for the EJBs. Which of the following are TRUE concerning the design of LineItemBean?
![]() A:LineItemBean must use JNDI to access the salesDB to create Connections.
B:LineItemBean instances are to be stored in the marketingDB data store.
C:LineItemBean has a custom primary key class.
D:LineItemBean uses its number field as the unique identifier for the database.
Correct Answers: A, D
9.A developer is creating a JSP. An instance of the class com.big.bank.BankAccount will be passed to the page through the HttpSession. The BankAccount is stored and referenced using the name "clientAccount". If it is NOT found in the session scope, the desired behavior is to have the JSP throw an exception. Which one of the <jsp:useBean> tags shown below BEST meets this requirement?
A: <jsp:useBean id="clientAccount" scope="session" beanName="BankAccount"
class="com.big.bank.BankAccount"/>
B: <jsp:useBean id="clientAccount" scope="session"
class="com.big.bank.BankAccount" type="com.big.bank.BankAccount"/>
C: <jsp:useBean id="clientAccount" scope="session"
type="com.big.bank.BankAccount"/>
D: <jsp:useBean id="clientAccount" scope="session" beanName="BankAccount"
class="com.big.bank.BankAccount" type="com.big.bank.BankAccount"/>
Correct Answers: C
10.A stateful Session bean is deployed using the container-managed transaction demarcation attribute RequiresNew. Which of the following are TRUE regarding exceptions in its business methods?
A:Transaction rollback occurs automatically when an application exception is thrown.
B:Transaction rollback occurs automatically when a system exception is thrown.
C:Transaction rollback restores bean state.
D:If EJBException is thrown by a business method, it must be declared in its throws clause.
E:Application exceptions should normally be passed directly through to the caller.
Correct Answers: B, E |
信息搜索
相关新闻
IBM 000-484 考试题库
- 添加日期:2006-12-19 21:56:57 来源: 点击:
A
D


