Given the following class definition with numbered lines:
How do you specify to use this mock CDI bean implementation instead of the regular implementation class?
A. Use the alternatives element in the beans.xml file and specify the class name in the class element within it.
B. Start up the server with the optional alternative command-line option, specifying any alternative class names in a comma-separated list.
C. Reorder the implementation names in the beans.xml file such that the desired alternative is listed earlier.
D. Delete the regular implementation class from the WAR.
Given the JPQL code fragment: Select pub.title, pub.author, pub.pages FROM Publisher pub Which two clauses do you add to this JPQL query to retrieve only those books with between 500 and 750 total pages? (Choose two.)
A. WHERE MIN(pages) >= 500 AND MAX(pages) <= 750
B. WHERE pub.pages <= 500 OR pub.pages >= 750
C. WHERE pub.pages BETWEEN 500 AND 750
D. WHERE pub.pages <= 500 AND pub.pages >=750
Give the code fragment:
And the code fragment:
The sendConfirmation() and reserve() methods should be executed in the same transactional context. Which transaction attributes do you ensure this?
A. Add annotations:@TransactionAttribute (TransactionAttributeType.REQUIRES_NEW) at line 2,@Transactional at line 9 and@TransactionAttribute ((TransactionAttributeType.MANDATORY) at line 12
B. No additional annotations are required.
C. Add annotations:@TransactionAttribute (TransactionAttributeType.REQUIRED) at line 2,@Transactional at line 9 and@TransactionAttribute ((TransactionAttributeType.REQUIRES_NEW) at line 12
D. Add annotations:@TransactionAttribute (TransactionAttributeType.MANDATORY) at line 2,@Transactional at line 9 and@TransactionAttribute ((TransactionAttributeType.REQUIRES_NEW) at line 12
Given the code fragment:
What output will be returned when this servlet is called a GET request?
A. Service() method called.
B. Service() method called.Get() method called.
C. An HTTP error
D. GET() method called.
Which statement is true about Java methods that are exposed as Web Service operations by using JAX-WS API?
A. The @WebResult annotation must exist.
B. Method parameters and return types must be JAXB compatible.
C. Method parameters must be declared by using @WebParam.
D. The @WebMethod annotation must exist.
A Persistence application locks entity x with a LockModeType.PESSIMISTIC_READ lock type. Which statement is true?
A. LockModeType.PESSIMISTIC_READ is the synonym of LockModeType.READ
B. This operation will force serialization among transactions attempting to read the entity data.
C. This operation will result in a TransactionRolledbackException if the lock cannot be obtained.
D. If the application updates the entity later, and the changes are flushed to the database, the lock will be converted to an exclusive look.
You are building the User Preferences page of an application. A user can change values, such as his or her name, password, address, company, and so on. These values are sent to a CDI backing bean via AJAX when the user tabs out of each field. However, the values must be retained in the CDI bean and stored in the database only when the user clicks the Save button. Which two scopes will allow your CDI bean to retain its state while the user is interacting with the User Preferences page? (Choose two.)
What will be the response to a HEAD request?
A. The findAll() method will be called and the employee list will be returned.
B. The findAll() method will be called and no employees will be returned.
C. No method will be invoked and no error will be returned.
D. No method will be invoked and a 404 error will be returned.
Your web application requires logic to remember items that a user placed into a shopping cart. Which two mechanisms should you use to associate that information with the user? (Choose two.)
A. HttpServletResponse objects
B. ServletContext objects
C. HttpSession objects
D. a database
Your class requires multiple resources defined, as shown in the following:
Which annotation do you use to group multiple @Resource declarations together for class-based injection, replacing <XXXX> in the code above?
You want to allow one set of roles to POST to a resource and another set of roles to GET it. Which two configuration options should you use? (Choose two.)
A. two separate @HttpMethodConstraints annotations and sets of roles
B. a single @HttpMethodContstraint annotation and a map of method to roles
C. two <web-resource-collection> with different <http-method> in the deployment descriptor
D. a single <web-resource-collection> with two <auth-constraint> with different <http-method> in the deployment descriptor
Given the code fragment:
Assuming this bean is used only in the code fragment above, how long will the injected Bean instance be available?
A. for the lifetime of the enterprise application
B. for the lifetime of the request
C. for the lifetime of the session
D. for the lifetime of the Service object
Which is a valid description of REST?
A. REST provides the same architectural properties as SOAP.
B. REST is a library that is part of JEE called JAX-RS.
C. REST is the conventional way of interacting with information resources.
D. REST is a Web Services standard supported by JEE and JAX-RS.