View Practice Tests

Java EE 7 Application Developer Practice Tests Includes

  • 1 Free Practice Test

  • 2 Mock Exams

Java EE 7 Application Developer Practice Tests - 1Z0-900 Mock Exams

MyExamCloud Java EE 7 Application Developer Practice Tests helps you to pass the exam in first attempt. Prepare with one of the best Java EE 7 Application Developer Study Course developed by Java Certified Experts. 100% Test Pass Guarantee.

Java EE 7 Application Developer Practice Tests and eBooks are available online at MyExamCloud Exam Simulator. This course contents can be accessed from PC, Mac, iPhone®, iPad®, Android™ Device. Mobile Apps available on iTunes and Android stores.

What is inside?

Inside MyExamCloud's Java EE 7 Application Developer Practice Course

  1. 1

    Set Your Goals

    Set Goals on Java EE 7 Application Developer exam topics
    (MyExamCloud PPA Tracker)

  2. 2

    Mock Exams

    2 Full length mock exams
    (MyExamCloud Practice Exams)

  3. 3

    Free Trial Exam

    1 Free Trial mock exam
    (MyExamCloud Practice Exam)

  4. 4

    Topic Based Questions

    Study mode to access topic based questions

  5. 5

    Answer with Explanation

    Exhaustive explanation with every question

  1. 6

    Exam Report

    Reports to assess performance history, strengths & weaknesses

  2. 7

    Goal Tracker

    Track your goals

  3. 8

    Focus On Your Weakness

    Focus lab to pinpoint your weak areas

  4. 9

    Lifetime License

    Unlimited lifetime access, Any where & Any time

Who created MyExamCloud Java EE 7 Application Developer Practice Tests?

The Java EE 7 Application Developer Practice Questions and explanations are created by highly qualified and Java Certified experts. The Authors has created this online course covering all Java EE 7 Application Developer exam objectives based on latest Oracle's changes.

Exam Process

Java EE 7 Application Developer Exam Information

The Java EE 7 Application Developer (Oracle Certified Professional, Java EE 7 Application Developer) certification improves object-orientated programming and Java fundamental skills. This Java Certification also tests Java SE 7 new features such as 'Lambda expressions' and 'Date and Time API'. As Java Language Specification has been updated for these new features, the experienced Java developers also need to learn the new style of coding by preparing for this exam.

Exam Process

Exam Number: 1Z0-900
Exam Title: Java EE 7 Application Developer

java ee 7 application developer 7 steps

Passing this exam, one can achieve Oracle Certified Professional, Java EE 7 Application Developer from Oracle. The real exam tests your OO and Java EE 7 skills by Single and Multiple choice questions.

Number of Questions: 70 Questions
Exam Duration 150 Minutes
Passing Score: 66%
Exam Format Multiple Choice
(which can have single or multiple answers)
Validated Against Java EE 7
Exam Price Price May vary from Country to country. Refer Oracle site for latest pricing.

The real exam is a computer based test provided by pearsonvue and it can be taken from any local test centers in your country.

Who can take Java EE 7 Application Developer?

Set The New Java Standard With Java EE 7 OCP Certification. Java EE 7 significantly changes the way you write code. Java SE 7 Certification gives you the tools to make the most of new features. The Java EE 7 Oracle Certified Professional (OCP) certification provides a foundational understanding of Java as well as programming in general. So it suits for most Java Professionals starting from beginner to expert.

  • College Students
  • Java Developer looking for Job
  • Java Trainers
  • Java Developers

Java EE 7 Application Developer Sample Questions

The following practice question is taken from MyExamCloud Java EE 7 Application Developer Study Plan.

Question 1.

Topic: Understand Java EE Architecture

Code:

@Stateless
@Local(CartSession.class)
public class PersistentCartSession implements CartSession {
    @Override

    public HashMap getCartItems(int userId) {
        HashMap cartItems = new HasMap();
        // logic to get cartItems
        return cartItems;

    }
}

@Stateless
@Local(CartSession.class)
public class TransientCartSession implements CartSession {
    // code here
}

@WebServlet(name = "CartServlet", urlPatterns = { "/cart" })
public class CartServlet extends HttpServlet {
    // code here
}

Which of the following code snippet inserted at // code here injects TransientCartSession in CartServlet?

  1. @EJB(beanName = "TransientCartSession")
    CartSession session;

  2. @EJB
    CartSession session;

  3. @EJB(type = "TransientCartSession")
    CartSession session;

Choice A is correct.

The existence of two implementations of the CartSession @Local interface breaks the convention and throws an exception during deployment when we use @EJB annotation without beasnName attribute.Enhancement of the @EJB annotation with the beanName attribute fixes the problem.The value of the beanName attribute is the simple name(getSimpleName) of the desired bean.

@EJB(beanName = "TransientCartSession")
CartSession session;

Exam Objective: Demonstrate understanding of the relationship between bean components, annotations, injections, and JNDI

Question 2.

Topic: Understand Java EE Architecture

You are developing a Java EE application where most of the user interface page requires responsive HTML output. The page must populate navigation menu based on logged in role.

Which of the following Java EE web components can achieve this goal?

  1. Java Servlet
  2. JavaServer Faces
  3. JavaServer Pages
  4. CDI Beans

Choice A and C are correct answers.

The functionality of Java EE web tier is to handle HTTP / HTTPS requests and generate dynamic contents.The Java EE web components are 1. Java Servlet, 2. Java Server Pages(JSP).They will run inside web container.

Choice B is incorrect.JavaServer Faces(JSF) is a web application framework and it is not a Java EE component.

Choice D is incorrect.Contexts and Dependency Injection(CDI) for the Java EE platform is one of several Java EE 6 features that help to knit together the web tier and the transactional tier of the Java EE platform.CDI is a set of services that, used together, make it easy for developers to use enterprise beans along with JavaServer Faces technology in web applications.

Exam Objective: Differentiate between application component functionalities as they apply to different tiers and containers, including Java EE Web Container, Business Logic implementation and WebServices

Question 3.

Topic: Manage Persistence using JPA Entities and BeanValidation

Which of the following statements are not true about entities?

  1. Entities support inheritance
  2. Entities does not support polymorphic associations
  3. Entities support polymorphic queries
  4. Entities does not support polymorphic queries

Choice B and D are correct answers.

Entities support inheritance, polymorphic associations, and polymorphic queries.

Exam Objective: Create JPA Entity and Relationship Object-Relational Mappings (ORM)

Question 4.

Topic: Manage Persistence using JPA Entities and BeanValidation

A developer working in EPractize Labs wants to fetch all customers whose order amount is greater than 500 USD. Assume that Customer entity is super class of PersonalCustomer and CorporateCustomer.
Which query can achieve this?

  1. select c,p,d from Customer c, PersonalCustomer p,  CorporateCustomer  d  where c.orderTotal  > 500 AND p. orderTotal > 500 and d. orderTotal > 500
  2. select c from Customer c where c.orderTotal > 500
  3. select c,p,d from Customer c, PersonalCustomer p,  CorporateCustomer  d  where c.orderTotal > 500
  4. select c,p,d from Customer c, PersonalCustomer p,  CorporateCustomer  d  where d.orderTotal > 500

Choice B is correct

By default, all queries are polymorphic. That is, the FROM clause of a query designates not only instances of the specific entity class(es) to which it explicitly refers, but subclasses as well. The instances returned by a query include instances of the subclasses that satisfy the query conditions. The following query returns all customer, including subtypes of Customer, such as PersonalCustomer and CorporateCustomer.

select c from Customer c where c.orderTotal > 500

Exam Objective: Create and execute JPQL statements

Question 5.

Topic: Implement Business Logic by Using EJBs

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

  1. Both stateful and stateless bean instances are required to survive container crashes.
  2. Both stateful and stateless bean instances must be able to handle concurrent invocations from different threads.
  3. A stateful bean with bean-managed transactions must commit or roll back any transaction before returning from a business method.
  4. The container passivates and activates them using methods annotated with @PrePassivate and @PostActivate annotations for stateful session beans.

Choice D is correct

In a stateless session bean with bean-managed transactions, a   business method must commit or roll back a transaction before returning.   However, a stateful session bean does not have this restriction. The container passivates and activates them using methods annotated with @PrePassivate and @PostActivate annotations for stateful session beans.

Exam Objective: Create session EJB components containing synchronous and asynchronous business methods, manage the life cycle container callbacks and use interceptors

Question 6.

Topic: Implement Business Logic by Using EJBs

An EJB developer writes a CMT stateless session bean with one local business interface. All business methods are declared as REQUIRED. The bean has an injected field sessionCtx of the type SessionContext.

Which two operations are allowed in a business method of the bean?

  1. sessionCtx.getEJBObject
  2. sessionCtx.setRollbackOnly
  3. sessionCtx.getMessageContext
  4. sessionCtx.getBusinessObject
  5. sessionCtx.getEJBLocalObject

Choice B and D are correct answers.

Call to getEJBObject is not valid, since the bean is local. IllegalStateException - Thrown if the instance invokes this method while the instance is in a state that does not allow the instance to invoke this method, or if the instance does not have a remote interface.

Call to setRollbackOnly is valid, since all methods are running in a transaction (REQUIRED)

Call to getMessageContext is not valid, since the bean is not a web service endpoint interface.

Call to getBusinessObject is valid. The method obtain an object that can be used to invoke the current bean through a particular business interface view or its no-interface view.

Exam Objective: Demonstrate understanding of how to control EJB transactions, distinguish Container Managed (CMT) and Bean Managed (BMT) transactions

Question 7.

Topic: Implement Business Logic by Using EJBs

What is true about TimerService interface?

  1. The TimerService interface is unavailable to stateless session beans.
  2. The TimerService interface is unavailable to stateful session beans.
  3. The TimerService interface is unavailable to singleton session beans.

Choice B is correct

A stateless session bean or singleton session bean can be registered with the EJB Timer Service for time-based event notifications. The container invokes the appropriate bean instance timeout callback method when a timer for the bean has expired.

Exam Objective: Create EJB timers

Question 8.

Topic: Use Java Message Service API

Which statement about message-driven beans is correct?

  1. Each message-driven bean instance will be invoked only one thread at a time.
  2. When dispatching messages to message bean instances the container must preserve the order in which messages arrive.
  3. Each message-driven bean is associated with a JMS queue, each bean instance in the pool will receive each message sent to the queue.
  4. If a message-driven bean is associated with a JMS durable subscription, each bean instance in the pool will receive each message sent to the durable subscription.

Choice A is correct

Message-driven beans (MDBs) support concurrent processing for both topics and queues. Previously, only concurrent processing for queues was supported.

To ensure concurrency, the container uses threads from the execute queue.

The maximum number of MDBs configured—via the max-beans-in-free-pool deployment descriptor element—to receive messages at one time cannot exceed the maximum number of execution threads. For example, if max-beans-in-free-pool is set to 50 but 25 is the maximum number of execution threads allowed, only 25 of the MDBs will actually receive messages.

Each message-driven bean instance will be invoked only one thread at a time.

Exam Objective: Describe the Java Message Service (JMS) messaging models and implement Java SE and Java EE message producers and consumers, including Message-Driven beans

Question 9.

Topic: Use Java Message Service API

Which of the following statements are true about Java EE 7 JMS message-driven bean with bean-managed transactions?

  1. The message receipt is part of the user transaction.
  2. Message acknowledgement is automatically handled by the container.
  3. Messages are always processed in the order they were sent to the queue
  4. Two messages read from the same queue may be processed at the same time within the same EJB container.

Choice B and D are correct answers.

A message-driven bean is an enterprise bean that allows Java EE applications to process messages asynchronously. It acts as a JMS message listener, which is similar to an event listener except that it receives messages instead of events. The messages may be sent by any Java EEcomponent--an application client, another enterprise bean, or a Web component--or by a JMS application or system that does not use Java EE technology.

Message acknowledgement is automatically handled by the container.

Two messages read from the same queue may be processed at the same time within the same EJB container.

Exam Objective: Use transactions with JMS API

Question 10.

Topic: Implement SOAP Services by Using JAX-WS and JAXB APIs 

Which of the following session management mechanisms JAX-WS can support?

  1. HTTP cookies
  2. URL rewriting
  3. SOAP based
  4. Java Servlet HTTP Session

Choice A, B and C are correct answers.

JAX-WS specification supports the following session management mechanisms.

Session APIs Definition of a session interface and methods to obtain the session interface and initiate sessions for handlers and service endpoint implementations.

HTTP based sessions The session management mechanism must support HTTP cookies and URL rewriting.

SOAP based sessions The session management mechanism must support SOAP based session information.

Exam Objective: Create SOAP Web Services and Clients using JAX-WS API

Question 11.

Topic: Implement SOAP Services by Using JAX-WS and JAXB APIs 

Given in the below code snippet

@XmlType(propOrder = { "name", "address", "mobileNumber" })

//Code here

public class Customer {
    @XmlElement(name = "Customer_Name", required = true)

    public void setName(String name) {    
        this.name = name;
    }

    @XmlElement(name = "Customer_Address")

    public void setAddress(String address) {
        this.address = address;
    }

    @XmlAttribute(name = "mobileNumber", required = true)

    public void setMobileNumber(String mobileNumber) {
            this.mobileNumber = mobileNumber;
    }
    
    ...
    
}

Which of the following JAXB marshal annotation convert Customer object as valid XML?

  1. @XmlElement(name = "Customer")
  2. @XmlRootElement(name = "Customer")
  3. @XmlMainElement(name = "Customer")

Choice B is correct.

The process of converting Java Objects into XML files are marshalling. The JAXB @XmlRootElement annotation denotes as root element and it is defined just before class starts.

@XmlElement in combination with setter methods.

@XmlAttribute to pass attributes to the XML nodes. These attributes can have properties like to be required or not.

@XmlType to indicate special options like to order of appearance in the XML.

Exam Objective: Define Java to XML Schema mappings to marshall and unmarshall Java Objects by using JAXB API

Question 12.

Topic: Implement SOAP Services by Using JAX-WS and JAXB APIs 

Assume that you have defined Customer class with valid JAXB marshal annotations.

Customer customer = new Customer();
customer.setName(“Shiv Ganesh”);
customer.setAddress(“919 Smart Street Phase I, Gandhi Nagar, Chennai”);
customer.setMobileNumber(“9000000”);

Which of the following code initiate JAXB marshaller?

  1. JAXBContext jaxbContext = JAXBContext.newInstance(Customer.class);
    Marshaller jaxbMarshaller = jaxbContext.initMarshaller();
  2. JAXBContext jaxbContext = JAXBContext.newInstance(Customer.class);
    Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
  3. JAXBContext jaxbContext = JAXBContext.createCustomer.class);
    Marshaller jaxbMarshaller = jaxbContext.createMarshaller();

Choice B is correct.

The class javax.xml.bind.JAXBContext provides a framework for validating, marshaling and un-marshaling XML into (and from) Java objects and it is the entry point to the JAXB API.

Exam Objective: Define Java to XML Schema mappings to marshall and unmarshall Java Objects by using JAXB API

Question 13.

Topic: Create Java Web Applications using Servlets

You are assigned to define servlet mappings in web.xml for the following classes.

  • com.epractizelabs.web.OrderServlet
  • com.epractizelabs.web.LicenseServlet

Which of the following web.xml fragments are correct?

  1. <servlet>
        <servlet-class>com.epractizelabs.web.OrderServlet</servlet-class>
        <servlet-name>order</servlet-name>
    </servlet>
  2. <servlet>
        <servlet-class>com.epractizelabs.web.OrderServlet</servlet-class>
        <servlet-name>order</servlet-name>
    </servlet>
  3. <servlet>
        <servlet-name>licenseServlet</servlet-name>
        <servlet-class>com.epractizelabs.web.LicenseServlet</servlet-class>
    </servlet>
  4. <servlet>
        <name>licenseServlet</name>
        <class>com.epractizelabs.web.LicenseServlet<class>
    </servlet>

Choice B is correct.

Why
Each <servlet> element defines a servlet for the web application.
The servlet-name defines the name of the servlet and servlet-class specifies the Java class that should be used by the servlet.
The servlet-name must occur before the servlet-class, so choice A is incorrect. We do not specify the extension .class for the servlet-class element. So choice C is incorrect.

Choice D is incorrect because the tag names are wrong.
Choice B has all the elements correct and hence is correct.

Why Not
Explained above.

Exam Objective: Create Java Servlets, describe how they are mapped to urls and use HTTP methods

Question 14.

Topic: Create Java Web Applications using Servlets

Code : A Servlet is mapped in the web.xml of the web application "order" as    

<web-app>
    ...
    
    <servlet-mapping>
        <servlet-name>ManageProfile</servlet-name>
        <url-pattern>ManageProfile</url-pattern>
    </servlet-mapping>
    ...

<web-app>

Which of the following URLs would be served by this Servlet?

  1. http://localhost/order/ManageProfile
  2. http://localhost/order/manageprofile
  3. http://localhost/order/manageProfile
  4. None of the above

Choice D is correct

Why
In the Web application deployment descriptor, the following syntax is used to define mappings:
A string beginning with a '/' character and ending with a '/*' suffix is used for path mapping.
A string beginning with a '*.' prefix is used as an extension mapping.
A string containing only the '/' character indicates the "default" servlet of the application.
In this case the servlet path is the request URI minus the context path and the path info is null. All other strings are used for exact matches only. Since in our case the <url-pattern> specifies a path mapping without a leading "/", the web application would fail to load. Hence choice D is correct while choices A, B, and C are incorrect.

Why Not
Explained above.

Exam Objective: Create Java Servlets, describe how they are mapped to urls and use HTTP methods

Question 15.

Topic: Create Java Web Applications using JSPs

Which EL implicit object gives access to the parameters stored in ServletContext object?

  1. context
  2. servletContext
  3. applicationScope

Choice C is correct

Why
"applicationScope" is a java.util.Map that maps application-scoped attributes stored in the ServletContext object.

Why Not
Explained Above.

Exam Objective: Describe JSP syntax, use tag libraries and  Expression Language (EL) 

Question 16.

Topic: Create Java Web Applications using JSPs

Given the JSP code:

<% request.setAttribute("orderNumber", "12345"); %> 

and the Classic tag handler code: 

8. public int doStartTag() throws JspException { 
       ...
20.    // some code here 
21. } 

Assume there are no other "orderNumber" attributes in the web application.

Which invocation on the pageContext object, inserted at line 9, assigns "12345" to the variable orderID?

  1. String orderID = (String) pageContext.getAttribute("orderNumber");
  2. String orderID = (String) pageContext.getRequestScope("orderNumber");
  3. String orderID = (String) pageContext.getContextScope("orderNumber");
  4. String orderID = (String) pageContext.getRequest().getAttribute("orderNumber");

Choice D is correct

Why
PageContext extends JspContext to provide useful context information for when JSP technology is used in a Servlet environment.
A PageContext instance provides access to all the namespaces associated with a JSP page, provides access to several page attributes, as well as a layer above the implementation details. Implicit objects are added to the pageContext automatically.
The getRequest method of pageContext  return current value of the request object (a ServletRequest).

Why Not
Explained above.

Exam Objective: Describe JSP syntax, use tag libraries and  Expression Language (EL) 

Question 17.

Topic: Create Java Web Applications using JSPs

Which of the following syntax is used to embed a Java scriptlet in a JSP page?

  1. <%@ ... %>
  2. <%  ... %>
  3. <%=   %>
  4. <%! ... %>

Choice B is correct

Why
Scriptlets can contain any code fragments that are valid for the scripting language specified in the language directive.
Scriptlets are executed at request-processing time. Whether or not they produce any output into the out stream depends on the code in the scriptlet.
When all the scriptlet fragments in a given translation unit are combined in the order they appear in the JSP page, they must yield a valid statement, or sequence of statements, in the specified scripting language.
If you want to use the %> character sequence as literal characters in a scriptlet, rather than to end the scriptlet, you can escape them by typing %\>.

Why Not
Explained Above.

Exam Objective: Describe JSP syntax, use tag libraries and  Expression Language (EL)

Question 18.

Topic: Implement REST Services using JAX-RS API

Which of the following EJB's can use JAX-RS @Path annotation?

  1. Stateless session bean
  2. Stateful session bean
  3. Singleton session bean
  4. Message-driven Bean

Choice A and C are correct answers.

JAX-RS works with Enterprise JavaBeans technology (enterprise beans) and Contexts and Dependency Injection for the Java EE Platform (CDI). The @Path annotation can be used with stateless session and singleton session beans.

Exam Objective: Create REST Services and clients using JAX-RS API

Question 19.

Topic: Implement REST Services using JAX-RS API

Given:

@Path("/customer/{id}")
public class Customer {
    public Customer(@PathParam("id") String id) {
        ...
    }
}

@Path("{lastname}")
public final class CustomerDetails {
    ...
}

A developer wants to convert this resource class scope as  application.

Which CDI managed bean code can achieve this?  

  1. @ApplicationScoped
    @Path("/customer/{id}")
    public class Customer {

        public Customer(@PathParam("id") String id) {
            ...
        }
    }

    @ApplicationScoped
    @Path("{lastname}")
    public final class CustomerDetails {
        ...
    }
    --

  2. @ApplicationScoped
    @Path("/customer/{id}")
    public class Customer {

        public Customer(@PathParam("id") String id) {
            ...
        }
    }

    @Path("{lastname}")
    public final class CustomerDetails {
        ...
    }
    --

  3. @Path("/customer/{id}")
    @ApplicationScoped
    public class Customer {

        public Customer() {
            ...
        }

        @Inject
        public Customer(@PathParam("id") String id) {
            ...
        }
    }

    @Path("{lastname}")
    @ApplicationScoped
    public class CustomerDetails {
            ...
    }

Choice C is correct

JAX-RS and CDI have slightly different component models. By default, JAX-RS root resource classes are managed in the request scope, and no annotations are required for specifying the scope. CDI managed beans annotated with @RequestScoped or @ApplicationScoped can be converted to JAX-RS resource classes.

Exam Objective: Create REST Services and clients using JAX-RS API

Question 20.

Topic: Create Java Applications using WebSockets

A developer want to create a server endpoint to wait for text messages. Which of the following code can achieve this goal?

  1. public class MyWebSocket extends Endpoint {
        @Override
        public void onOpen(Session session, EndpointConfig ec) {
            final RemoteEndpoint.Basic remote = session.getBasicRemote();
            session.addMessageHandler(String.class,  new MessageHandler.Whole < String > () {
                public void onMessage(String text) {
                    try {
                        remote.sendText("Your message (" + text + ") has been recieved. Thanks !");
                    } catch (IOException ioe) {
                        ioe.printStackTrace();
                    }
                }
            });
        }
    }
  2. @ServerEndpoint("/welcome")
    public class MyWebSocket {
        @OnMessage
        public String handleMessage(String message) {
            return "Your message (" + text + ") has been recieved. Thanks !";
        }
    }
  3. Both A and B

Choice C is correct.

The endpoint class can be implemented by API classes or by annotations. The Choice A code uses Websocket API classes and Choice B uses WebSocket API annotations.

The class level @ServerEndpoint annotation indicates that a Java class is to become a websocket endpoint at runtime.

Developers may use the value attribute to specify a URI mapping for the endpoint.

Exam Objective: Create WebSocket Server and Client Endpoint Handlers using JSR 356 API and JavaScript

Question 21.

Topic: Create Java Applications using WebSockets

@ServerEndpoint("/welcome")
public class MyWebSocket {
    // Code here

    public void handleNewConnection() {
        System.out.print(“New connection recieved”);
    }

    @OnMessage
    public String handleMessage(String message) {
        return "Your message (" + text + ") has been recieved. Thanks !";
    }
}

Which annotation inserted at // Code here will enabled handleNewConnection method must be called when there is a new connection?

  1. @OnOpen
  2. @OnClose
  3. @OnNewConnection
  4. @Init

Choice A is correct.

The method level @OnOpen and @OnClose annotations allow the developers to decorate methods on their @ServerEndpoint annotated Java class to specify that they must be called by the implementation when the resulting endpoint receives a new connection from a peer or when a connection from a peer is closed, respectively.

Exam Objective: Understand and utilise WebSockets communication style and lifecycle

Question 22.

Topic: Develop Web Applications using JSFs

Given code :

//index.xhtml
<h:commandLink action="examBoatSearch">
  <h:outputText value="Proceed to ExamBoat Search Page"/>
</h:commandLink>

Which navigation rule correctly defines examBoatSearch?

Assume that ExamBoat search page is search.jsp.

  1. <navigation-rule>
    <from-view-id>/index.xhtml</from-view-id>
        <navigation-case>
            <from-action>examBoatSearch</from-action>
            <to-view-id>/search.jsp</to-view-id>
        </navigation-case>
    </navigation-rule>
  2. <navigation-rule>
    <from-view-id>/index.xhtml</from-view-id>
        <navigation-case>
            <from-outcome>examBoatSearch</from-outcome>
            <to-view-id>/search.jsp</to-view-id>
        </navigation-case>
    </navigation-rule>
  3. <navigation-rule>
    <from-view-id>/index.xhtml</from-view-id>
        <navigation-case>
            <from-action>#{ManagedBean.actionMethod}</from-action>
            <to-view-id>/search.jsp</to-view-id>
        </navigation-case>
    </navigation-rule>
  4. None of the above, Both from-action and from-outcome are required.

Choice B is correct

The form-action element along with from-outcome is needed for dynamic navigation where the output of the action method specified in the from-action element is compared to the from-outcome value. Here it is static navigation where we just need to call next page. For this static navigation, this is the navigation from-outcome value i.e. examBoatSearch that will map to search.xhtml in the navigation rule.

Exam Objective: Describe JSF architecture, lifecycle and navigation

Question 23.

Topic: Develop Web Applications using JSFs

Which JavaServer Faces life cycle will be started when a link or a button component is clicked?

  1. Update Model Values Phase
  2. Apply Request Values Phase
  3. Invoke Application Phase
  4. Restore View Phase
  5. Render Response Phase
  6. Process Validations Phase

Choice D is correct.

When a request for a JavaServer Faces page is made, usually by an action such as when a link or a button component is clicked, the JavaServer Faces implementation begins the Restore View phase. During this phase, the JavaServer Faces implementation builds the view of the page, wires event handlers and validators to components in the view, and saves the view in the FacesContext instance, which contains all the information needed to process a single request. All the application's components, event handlers, converters, and validators have access to the FacesContext instance. If the request for the page is an initial request, the JavaServer Faces implementation creates an empty view during this phase and the lifecycle advances to the Render Response phase, during which the empty view is populated with the components referenced by the tags in the page. If the request for the page is a postback, a view corresponding to this page already exists in the FacesContext instance. During this phase, the JavaServer Faces implementation restores the view by using the state information saved on the client or the server. Exam Objective: Identify the life cycle stages of JSF, flow of request processing, and purpose of FacesContext.

Exam Objective: Describe JSF architecture, lifecycle and navigation

Question 24.

Topic: Secure Java EE 7 Applications

Which of the following code  defines login-config for Form-based authentication?

  1. <login-config>
        <auth-method>FORM</auth-method>
        <realm-name>file</realm-name>
        <form-login-config>
            <form-login-page>/logon.jsp</form-login-page>
            <form-error-page>/logonError.jsp</form-error-page>
        </form-login-config>
    </login-config>
  2. <login-config>
        <auth-method>FORM</auth-method>
        <realm-name>file</realm-name>
        <form-config>
            <login-page>/logon.jsp</form-login-page>
            <error-page>/logonError.jsp</form-error-page>
        </form-config>
    </login-config>
  3. <login-config>
        <auth-method>FORM</auth-method>
        <realm>file</realm>
        <form-login-config>
            <form-login-page>/logon.jsp</form-login-page>
            <form-error-page>/logonError.jsp</form-error-page>
        </form-login-config>
    </login-config>
  4. <login-config>
        <authentication-method>FORM</authentication-method>
        <realm-name>file</realm-name>
        <form-login-config>
            <form-login-page>/logon.jsp</form-login-page>
            <form-error-page>/logonError.jsp</form-error-page>
        </form-login-config>
    </login-config>

Choice A is correct.

Why
The main advantage of form based authentication is the customization of look and feel of login and error pages. 

A custom HTML form is used to capture the username and password, which leads to this customization. 
The web application deployment descriptor contains entries for a login form and error page. 

<login-config>
    <auth-method>FORM</auth-method>
    <realm-name>file</realm-name>
    <form-login-config>
        <form-login-page>/logon.jsp</form-login-page>
        <form-error-page>/logonError.jsp</form-error-page>
    </form-login-config>
</login-config>

The login form must contain fields for entering a username and a password. These fields must be named j_username and j_password, respectively.
Typical form login page (taken from http://www.123testlab.com):

Why Not
Explained above.

Exam Objective: Describe Java EE declarative and programmatic security and configure authentication using application roles and security constraints and Login Modules

Question 25.

Topic: Use CDI Beans 

Given the below CDI beans

// Customer  bean
@Default
public class Customer {
    ...
}

// Product bean
public class Product {
    ...
}

How many qualifiers are defined Customer and product beans?

  1. Customer bean has one qualifier and Product bean has none
  2. Both Customer and Product bean has only one qualifier
  3. Both Customer and Product bean has two qualifiers
  4. Both Customer and Product bean has three qualifiers

Choice C is correct.

Every bean has the built-in qualifier @Any, even if it does not explicitly declare this qualifier, except for the special @New qualified beans defined in @New qualified beans.

If a bean does not explicitly declare a qualifier other than @Named or @Any, the bean has exactly one additional qualifier, of type @Default. This is called the default qualifier.

Both Customer and Product declarations result in a bean with two qualifiers: @Any and @Default.

Exam Objective: Create CDI Bean Qualifiers, Producers, Disposers, Interceptors, Events and Stereotypes

Question 26.

Topic: Use Concurrency API in Java EE 7 Applications

public class ReportTask implements Runnable {
    public int final NEW_REPORT = 1;
    public int final OLD_REPORT = 2;
    int reportType = NEW_REPORT;
    
    public ReportTask() {}
    
    public ReportTask(int reportType) {
        this.reportType = reportType;
    }
    
    public void run() {
        // Logic here
    }
}

public class ReportServlet extends HttpServlet {
    
    @Resource(name = "concurrent/MyAppTasksExecutor")
    ManagedExecutorService mes;

    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //Code here
    }
}

Which of the following inserted at //code here correctly submit ReportTask to MyAppTasksExecutor?

  1. ReportTask reportTask = new ReportTask();
    reportTask.start();
  2. ReportTask reportTask = new ReportTask();
    Future reportFuture = mes.run(reportTask);
  3. ReportTask reportTask = new ReportTask();
    Future reportFuture = mes.submit(reportTask);
  4. ReportTask reportTask = new ReportTask();
    Future reportFuture = mes.join(reportTask);

Choice C is correct.

The submit method submit the task to the ManagedExecutorService. To handle to the task, the Future is cached so that the client can query the results of the report. The Future will contain the results once the task has completed.

Exam Objective:  Demonstrate understanding of Java Concurrency Utilities and use Managed Executors

Question 27.

Topic: Use Batch API in Java EE 7 Applications

The PayrollJob batch job involves reading input data for payroll processing from a XL sheet. Each line in the file contains an employee ID and the base salary (per month) for one employee. The batch job then calculates the tax to be withheld, the bonus, and the net salary. The job finally needs to write out the processed payroll records into a database table.

@Named
public class SimpleItemReader extends AbstractItemReader {
    @Inject
    private JobContext jobContext;
    ...
}
public class SimpleItemProcessor implements ItemProcessor {
    @Inject
    private JobContext jobContext;
    
    public Object processItem(Object obj) throws Exception {
        ....
    }
}
@Named
public class SimpleItemWriter extends AbstractItemWriter {
    @PersistenceContext
    EntityManager em;
   
    public void writeItems(List list) throws Exception {
            for (Object obj: list) {
                System.out.println("PayrollRecord: " + obj);
                em.persist(obj);
            }
        }
        ....
}

Which JSL correctly defines chunk-style step for these batch jobs?

  1. <job id="PayrollJob" xmlns=http://xmlns.jcp.org/xml/ns/javaee version="1.0">
        <step id="process">
            <chunk item-count="2">
                <reader ref="simpleItemReader/>
                <processor ref="simpleItemProcessor/>
                <writer ref="simpleItemWriter/>
            </chunk>
        </step>
    </job>
  2. <job id="PayrollJob" xmlns=http://xmlns.jcp.org/xml/ns/javaee version="1.0">
        <step id="process">
            <chunk item-count="2">
                <reader class="SimpleItemReader/>
                <processor class="SimpleItemProcessor/>
                <writer class="SimpleItemWriter/>
            </chunk>
        </step>
    </job>
  3. <job id="PayrollJob" xmlns=http://xmlns.jcp.org/xml/ns/javaee version="1.0">
        <step id="process">
            <chunk item-count="2">
                <reader name="simpleItemReader/>
                <processor name="simpleItemProcessor/>
                <writer name="simpleItemWriter/>
            </chunk>
        </step>
    </job>

Choice A is correct.

It is a chunk-style step and has (as required for a chunk-style step), an ItemReader, an ItemProcessor, and an ItemWriter. The implementations for ItemReader, ItemProcessor, and ItemWriter for this step are specified using the ref attribute in the <reader>, <processor>, and <writer> elements.

Exam Objective: Describe batch jobs using JSL XML documents and JSR 352 API

27 Java EE 7 Application Developer Practice Questions - Free

You can access 27 Practice Questions for Oracle Certified Professional Java EE 7 Application Developer, from MyExamCloud Exam Simulator

Take Free Practice Test

After Java EE 7 Application Developer Exam

Within 30 minutes of completing your Java EE 7 Application Developer exam, you will receive an email from Oracle notifying you that your exam results are available in CertView. If you have previously authenticated your CertView account, simply login and select the option to "See My New Exam Result Now."

If you have not authenticated your CertView account yet at this point, you will need to proceed with your account authentication.

Authentication requires an Oracle Single Sign On username and password and the following information from your Pearson VUE profile: email address and Oracle Testing ID. You will be taken to CertView to log in once your account has been authenticated.

Sample Java EE 7 Application Developer Certificate

Sample java ee 7 application developer Certificate

Java EE 7 Application Developer Benefits

The reason for taking Oracle Java Certification is to differentiate general programmers from certified experts. You may get additional benefits like getting a good job, salary hike, designation changes, role changes and higher promotion.

Stand out from the millions of Java crowd. Increase your marketability with Java EE 7 Application Developer Certification on the most used programming language in the world - Java.

Related Articles:https://www.epractizelabs.com/myexamcloud/2018/06/20/java-ee-7-application-developer-certification/

How to register for Java EE 7 Application Developer

  • Step 1:Oracle :: Pearson VUEOpen this page, If you are a first time visitor then click on Create an account
  • Step 2:Click on Proctored Exams
  • Step 3:You will see a screen to search exam. Enter the exam code you want to give. You can get exam code details at Java Certifications MyExamCloud Exam Collections
  • Step 4:You will see the exam name, fees for the exam and language of exam in the screen, Click on Schedule this exam.
  • Step 5.You will see Confirm Exam Selection screen, click on the Proceed to Scheduling.
  • Step 6. Now, Enter into the search box, the near by place for test center. Select the test center and click on Next.
  • Step 7.Select Date and Time on which you will write your exam.
  • Step 8.Check the information again, date and time. After confirming then click on the Proceed to Checkout.
  • Step 9.After that you need to check the information and enter the credit card details.

Congrats, you have successfully scheduled your Java Certification exam.

Java EE 7 Application Developer Topics

Understand Java EE Architecture

  • Describe Java EE 7 standards, containers, APIs, and services
  • Differentiate between application component functionalities as they apply to different tiers and containers, including Java EE Web Container, Business Logic implementation and WebServices
  • Create, package and deploy Java EE application 
  • Demonstrate understanding of Enterprise JavaBeans and CDI beans, their lifecycle and memory scopes
  • Demonstrate understanding of the relationship between bean components, annotations, injections, and JNDI

Implement Business Logic by Using EJBs

  • Create session EJB components containing synchronous and asynchronous business methods, manage the life cycle container callbacks and use interceptors
  • Demonstrate understanding of how to control EJB transactions, distinguish Container Managed (CMT) and Bean Managed (BMT) transactions
  • Create EJB timers

Implement SOAP Services by Using JAX-WS and JAXB APIs 

  • Create SOAP Web Services and Clients using JAX-WS API 
  • Define Java to XML Schema mappings to marshall and unmarshall Java Objects by using JAXB API

Create Java Web Applications using JSPs

  • Describe JSP life cycle
  • Describe JSP syntax, use tag libraries and  Expression Language (EL) 
  • Handle errors using Servlets and Java Server Pages

Create Java Applications using WebSockets

  • Understand and utilise WebSockets communication style and lifecycle
  • Create WebSocket Server and Client Endpoint Handlers using JSR 356 API and JavaScript
  • Produce and consume, encode and decode WebSocket messages 

Secure Java EE 7 Applications

  • Describe Java EE declarative and programmatic security and configure authentication using application roles and security constraints and Login Modules
  • Describe WebServices security standards

Use Concurrency API in Java EE 7 Applications

  • Demonstrate understanding of Java Concurrency Utilities and use Managed Executors

Manage Persistence using JPA Entities and BeanValidation 

  • Create JPA Entity and Relationship Object-Relational Mappings (ORM)
  • Use Entity Manager to perform database operations, transactions and locking with JPA entities
  • Handle entity data with conversions, validations, and key generation
  • Create and execute JPQL statements

Use Java Message Service API

  • Describe the Java Message Service (JMS) messaging models and implement Java SE and Java EE message producers and consumers, including Message-Driven beans
  • Use transactions with JMS API

Create Java Web Applications using Servlets

  • Create Java Servlets, describe how they are mapped to urls and use HTTP methods
  • Handle HTTP headers, parameters, cookies
  • Manage servlet life cycle with container callback methods and WebFilters

Implement REST Services using JAX-RS API

  • Understand and Apply REST service conventions 
  • Create REST Services and clients using JAX-RS API

Develop Web Applications using JSFs

  • Describe JSF arcitecture, lifecycle and  navigation
  • Understand JSF syntax and use JSF Tag Libraries
  • Handle localisation and produce messages
  • Use Expression Language (EL) and interact with CDI beans

Use CDI Beans 

  • Create CDI Bean Qualifiers, Producers, Disposers, Interceptors, Events and Stereotypes

Use Batch API in Java EE 7 Applications

  • Describe batch jobs using JSL XML documents and JSR 352 API

Testimonial

testimonial user profile image
Thanh son Le

facebook

I found the Training Lab Exams to be fantastic! The questions were more intense than the actual exams. It has become a common practice for the training staff at our company to recommend your products. Thanks!