Which statement describe about Message-Driven Beans is correct? (Choose one)

Which statement describe about Message-Driven Beans is correct? (Choose one)



a. Message-Driven Beans are stateful
b. An EJB 3.0 message-driven beans can itself be the client of another message-driven beans
c. The bean mediates between the client and the other components of the application, presenting a simplified view to the client.





Answer: A

Which statement about an entity instance lifecycle is correct?

Which statement about an entity instance lifecycle is correct?



a. A new entity instance is an instance with a fully populated state.
b. A detached entity instance is an instance with no persistent identity.
c. A removed entity instance is NOT associated with a persistence context.
d. A managed entity instance is the instance associated with a persistence context.




Answer: D

Which is NOT a correct statement about entity beans?

Which is NOT a correct statement about entity beans?




a. They are used to store persistent data
b. They are used to share data among clients
c. They are used to implement business processes
d. They are used to represent data stored in a RDBMS



Answer: C

Which statement about entity manager is true?

Which statement about entity manager is true?



a. A container-managed entity manager must be a JTA entity manager.
b. An entity manager injected into session beans can use either JTA or resource-local transaction control.
c. An entity manager created by calling the EntityManagerFactory.createEntityManager method always uses JTA transaction control.




Answer: A

If you want to send an entity object as the pass by value through a remote interface, which of the following statements are valid? (Choose one)

If you want to send an entity object as the pass by value through a remote interface, which of the following statements are valid? (Choose one)



a. @Entity
a. public class Employees implements SessionSynchronization{
a. ...
a. }
b. @Entity
b. public class Employees implements Serializable{
b. ...
b. }
c. public class Employees implements Serializable{
c. ...
c. }
d. @entity
d. public class Employees implements Serializable{
d. ...
d. }





Answer: B

Which is NOT true about stateless session beans?

Which is NOT true about stateless session beans?



a. They are CANNOT hold client state
b. They are used to implement business logic
c. They are used to represent data stored in a RDBMS
d. They are an Enterprises Beans



Answer: C

Which statement is true about EJB 3.0 stateful session beans and stateless session beans?

Which statement is true about EJB 3.0 stateful session beans and stateless session beans?



a. Both can have multiple remote and local business interfaces
b. Only the stateful session bean class is required to implement java.io.Serializable interface
c. Both can be passivated by the EJB container to preserve resource
d. Only the stateless session bean class is required to implement java.io.Serializable interface





Answer: A

A developer is working on a project that includes both EJB 2.1 and EJB 3.0 session beans. A lot of business logic has been implemented and tested in these EJB 2.1 session beans. Some EJB 3.0 session beans need to access this business logic. Which design approach can achieve this requirement?

A developer is working on a project that includes both EJB 2.1 and EJB 3.0 session beans. A lot of business logic has been implemented and tested in these EJB 2.1 session beans. Some EJB 3.0 session beans need to access this business logic. Which design approach can achieve this requirement?



a. Add adapted home interfaces to EJB 3.0 session beans to make EJB 3.0 and EJB 2.1 session beans interoperable.
b. Add EJB 3.0 business interfaces to existing EJB 2.1 session beans and inject references to these business interfaces into EJB 3.0 session beans.
c. No need to modify existing EJB 2.1 session beans. Use the @EJB annotation to inject a reference to the EJB 2.1 home interface into the EJB 3.0 bean class.





Answer: A

Which statement is true about EJB 3.0 containers?

Which statement is true about EJB 3.0 containers?





a. javax.naming.initialContext is guaranteed to provide a JNDI name space
b. Java Telephony API is guaranteed to be available for session and message beans
c. The Java 2D API is guaranteed to be available for session beans



Answer: A

Which statements are BEST describe prefix attribute of <%@ taglib prefix=...%>directive of JSP file?

Which statements are BEST describe prefix attribute of <%@ taglib prefix=...%>directive of JSP file?




a. Specifies the relative or absolute URI of the tag library descriptor.
b. Specifies the required prefix that distinguishes custom tags from built-in tags. The prefix names jsp, jspx, java, javax, servlet, sun and sunw are reserved.
c. Allows programmers to include their own new tags in the form of tag libraries. These libraries can be used to encapsulate functionality and simplify the coding of a JSP.
d. The scripting language used in the JSP. Currently, the only valid value for this attribute is java.




Answer: A

Which statements are BEST describe property attribute of Action?

Which statements are BEST describe property attribute of <jsp:setProperty property=.... /> Action?



a. The ID of the JavaBean for which a property (or properties) will be set.
b. The name of the property to set. Specifying "*" for this attribute causes the JSP to match the request parameters to the properties of the bean.
c. If request parameter names do not match bean property names, this attribute can be used to specify which request parameter should be used to obtain the value for a specific bean property.
d. The value to assign to a bean property. The value typically is the result of a JSP expression.





Answer: A

Which statements are BEST describe errorPage attribute of <%@ page errorPage=....%> directive?

Which statements are BEST describe errorPage attribute of <%@ page errorPage=....%> directive?



a. Any exceptions in the current page that are not caught are sent to the error page for processing. The error page implicit object exception references the original exception.
b. Specifies if the current page is an error page that will be invoked in response to an error on another page. If the attribute value is true, the implicit object exception is created and references the original exception that occurred.
c. Specifies the MIME type of the data in the response to the client. The default type is text/html.
d. Specifies the class from which the translated JSP will be inherited. This attribute must be a fully qualified package and class name.




Answer: A

A bean present in the page and identified as 'mybean' has a property named 'name'. Which of the following is a correct way to print the value of this property?

A bean present in the page and identified as 'mybean' has a property named 'name'. Which of the following is a correct way to print the value of this property?



a. <jsp:getProperty name="mybean" property="name"/>
b. <%out.println(mybean.getName())%>
c. <%=out.println(mybean.getName())%>
d. <%=jsp:getProperty name="mybean" property="name"%>




Answer: A

Which statements are BEST describe Action?

Which statements are BEST describe <jsp:getProperty> Action?



a. Specifies the relative URI path of the resource to include. The resource must be part of the same Web application.
b. Dynamically includes another resource in a JSP. As the JSP executes, the referenced resource is included and processed.
c. Sets a property in the specified JavaBean instance. A special feature of this action is automatic matching of request parameters to bean properties of the same name.
d. Gets a property in the specified JavaBean instance and converts the result to a string for output in the response.




Answer: C

What is the consequence of attempting to access the following JSP page?

What is the consequence of attempting to access the following JSP page? 


<question><html>
<question><body>
<question><%!
<question> public void _jspService(HttpServletRequest request, HttpServletResponse response) {
<question> out.write("A");
<question> }
<question> %>
<question><% out.write("B"); %>
<question></body>
<question></html>


a. Duplicate method compilation error.
b. "A" is output to the response.
c. "B" is output to the response.
d. "A" is output to the response before "B".




Answer: A

What is the result of attempting to access the following JSP page?

What is the result of attempting to access the following JSP page? 


<question><html>
<question><body>
<question><%! public String methodA() {
<question> return methodB();
<question>}
<question>%>
<question><%! public String methodB() {
<question> return "JAD Final Test";
<question>}
<question>%>
<question><h2><%= methodA() %></h2>
<question></body>
<question></html>

a. "JAD Final Test" is output to the resulting web page.
b. A translation error occurs.
c. A runtime error occurs.
d. The web page is blank.




Answer: A

Which of the following statements is true? (Choose one)

Which of the following statements is true? (Choose one)



a. Session data is shared across multiple webapps in the same webserver/servlet container.
b. Any serializable object can be put into a session.
c. A session can only be invalidated after "session-timeout" minutes of inactivity.
d. To use session, the client browser must support cookies.


Answer: A

Which of the following lines of code, in the doPost() method of a servlet, uses the URL rewriting approach to maintaining sessions? (Choose one)

Which of the following lines of code, in the doPost() method of a servlet, uses the URL rewriting approach to maintaining sessions? (Choose one)





a. out.println("<a href=' "+response.encodeURL("/servlet/XServlet")+" '>Click here</a>"));
b. out.println("<a href=' "+request.rewrite("/servlet/XServlet")+" '>Click here</a>"));
c. out.println(response.rewrite("<a href='/servlet/XServlet'>Click here</a>"));
d. request.useURLRewriting();

Answer: A

Which of the following statement correctly store an object associated with a name at a place where all the servlets/jsps of the same webapp participating in a session can access it? Assume that request, response, name, value etc. are references to objects of appropriate types.(Choose one)

Which of the following statement correctly store an object associated with a name at a place where all the servlets/jsps of the same webapp participating in a session can access it? Assume that request, response, name, value etc. are references to objects of appropriate types.(Choose one)




a. request.getSession().setAttribute(name, value);
b. response.setAttribute(name, value);
c. request.setAttribute(name, value);
d. request.setParameter(name, value)


Answer: A

Study the statements: 1) The context path contains a special directory called WEB-INF, which contains the deployment descriptor file, web.xml. 2) A client application may directly access resources in WEB-INF or its subdirectories through HTTP.

Study the statements:
1) The context path contains a special directory called WEB-INF, which contains the deployment descriptor file, web.xml.
2) A client application may directly access resources in WEB-INF or its subdirectories through HTTP.




a. Only statement 1 is true
b. Only statement 2 is true
c. Both 1 and 2 are true
d. Both 1 and 2 are not true



Answer: A

HTTP is a "stateless" protocol: each time a client retrieves a Web page, it opens a separate connection to the Web server, and the server does not automatically maintain contextual information about a client.

HTTP is a "stateless" protocol: each time a client retrieves a Web page, it opens a separate connection to the Web server, and the server does not automatically maintain contextual information about a client.



a. True
b. False



Answer: A

The sendRedirect method defined in the HttpServlet class is equivalent to invoking the setStatus method with they following parameter and a Location header in the URL. Select one correct answer.

The sendRedirect method defined in the HttpServlet class is equivalent to invoking the setStatus method with they following parameter and a Location header in the URL. Select one correct answer.




a. SC_OK
b. SC_MOVED_TEMPORARILY
c. SC_NOT_FOUND
d. SC_INTERNAL_SERVER_ERROR
e. ESC_BAD_REQUEST


Answer: B

Which is true about JDBC?

Which is true about JDBC?




a. All JDBC drivers are pure Java.
b. The JDBC API is included in J2SE
c. The JDBC API is an extension of the ODBC API
d. JDBC is used to connect to MOM (Message-Oriented Middleware Product)




Answer: B

Which statement is true about the use of a persist operation in a transaction of an Entity Beans

Which statement is true about the use of a persist operation in a transaction of an Entity Beans




a. If a user persists a detached object it always becomes managed
b. The persist operation on an entity always cascades to its related entities
c. If a user persists a new entity with an existing primary key the transaction will fail
d. If a user persists a managed entity an exception may be thrown by the persist operation





Answer: C

Which is NOT a correct statement about entity beans?

Which is NOT a correct statement about entity beans?



a. They are used to store persistent data
b. They are used to share data among clients
c. They are used to implement business processes
d. They are used to represent data stored in a RDBMS



Answer: C

Which statement is true about EJB 3.0 stateful session beans and stateless session beans? (Choose one)

Which statement is true about EJB 3.0 stateful session beans and stateless session beans? (Choose one)




a. Both can have multiple remote and local business interfaces
b. Only the stateful session bean class is required to implement java.io.Serializable interface
c. Both can be passivated by the EJB container to preserve resource
d. Only the stateless session bean class is required to implement java.io.Serializable interface



Answer: A

Which is NOT true about stateless session beans?

Which is NOT true about stateless session beans?





a. They are CANNOT hold client state
b. They are used to implement business logic
c. They are used to represent data stored in a RDBMS
d. They are an Enterprises Beans



Answer: C

Which is true about JEE ( or J2EE)?

Which is true about JEE ( or J2EE)?




a. JEE applications depend on web servers
b. JEE runs on consumer and embedded devices
c. JEE includes servlet APIs and EJB APIs
d. JEE can be run only on tomcat web servers


Answer: C

Which statements are BEST describe taglib directive of JSP file?

Which statements are BEST describe taglib directive of JSP file?




a. Defines page settings for the JSP container to process
b. Causes the JSP container to perform a translation-time insertion of another resource's content. As the JSP is translated into a servlet and compiled, the referenced file replaces the include directive and is translated as if it were originally part of the JSP.
c. Allows programmers to include their own new tags in the form of tag libraries. These libraries can be used to encapsulate functionality and simplify the coding of a JSP.
d. The scripting language used in the JSP. Currently, the only valid value for this attribute is java.




Answer: C