oracle 1z0-900 practice test

Java EE 7 Application Developer Exam

Last exam update: Sep 30 ,2024
Page 1 out of 4. Viewing questions 1-15 out of 69

Question 1

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
Answer:

B,D

User Votes:
A
50%
B 1 votes
50%
C 1 votes
50%
D 1 votes
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 2

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
Answer:

D

User Votes:
A
50%
B
50%
C 1 votes
50%
D 1 votes
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 3

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.
Answer:

D


Explanation:
Reference:
https://docs.oracle.com/javaee/6/tutorial/doc/giepu.html

User Votes:
A
50%
B
50%
C
50%
D 1 votes
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 4

Given:

Which annotation do you use on line 1 to ensure that clients immediately time out when attempting
to concurrently invoke callMethod () while another client is already accessing the bean?

  • A. @AccessTimeout (value = 1, unit = TimeUnit.SECONDS)
  • B. @AccessTimeout (null)
  • C. @AccessTimeout (-1)
  • D. @AccessTimeout (0)
Answer:

D


Explanation:
Reference:
http://tomee.apache.org/examples-trunk/access-timeout/

User Votes:
A
50%
B
50%
C
50%
D 1 votes
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 5

Which statement is true about the relationship between HTTP and WebSockets?

  • A. A WebSocket connection is a bi-directional HTTP session with message-handling support.
  • B. A WebSocket connection is initialized with an HTTP handshake.
  • C. A WebSocket connection can be initialized by either client or server.
  • D. A WebSocket connection uses HTTP protocol to exchange data with the browser.
Answer:

D

User Votes:
A
50%
B
50%
C
50%
D 1 votes
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 6

A Java EE application that uses an EJB container must communicate with a legacy system developed
using non-Java technologies.
Which two Java EE technologies can be used in the integration tier of the application? (Choose two.)

  • A. JMS
  • B. JSF
  • C. JPA
  • D. JCA
Answer:

A,B

User Votes:
A 1 votes
50%
B 1 votes
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 7

Which code snippet indicates that the page you are designing is capable of handling errors?

  • A. <%@page errorPage=“errorHandler.jsp”%>
  • B. <%= requestScope[‘javax.servlet.error’] !=null %>
  • C. <%@page isErrorPage=“true”%>
  • D. <c:set var=“errorHandler” value=“true”/>
Answer:

C

User Votes:
A 1 votes
50%
B
50%
C 1 votes
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 8

Which two elements CANNOT be injected by using an @Inject annotation? (Choose two.)

  • A. static fields
  • B. instance fields declared final
  • C. concrete methods
  • D. abstract methods
Answer:

B,D


Explanation:
Reference:
https://docs.oracle.com/javaee/6/api/javax/inject/Inject.html

User Votes:
A
50%
B 1 votes
50%
C
50%
D 1 votes
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 9

Given the following code:

What should you do at line 1 to enable this servlet receive request data without blocking?

  • A. Use a Runnable instance with the start () method of AsyncContext.
  • B. Define a ReadListener and assign it to the request input stream.
  • C. Create a Callable class and delegate this operation to a ManagedExecutorService by using the dispatch method of AsyncContext.
  • D. Define an AsyncListener and assign it to the AsyncContext object.
Answer:

D

User Votes:
A
50%
B
50%
C
50%
D 1 votes
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 10

Identify two valid WebSocket message types for which you can register handlers. (Choose two.)

  • A. Error Message
  • B. Binary Message
  • C. Pong Message
  • D. Ping Message
Answer:

B,C


Explanation:
Reference:
https://docs.oracle.com/javaee/7/api/javax/websocket/Session.html

User Votes:
A
50%
B 1 votes
50%
C 1 votes
50%
D 1 votes
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 11

You have been assigned to the Widget Editor portion of an application. It contains a Widget Editor
Facelet page, the Widget class, and a simple WidgetEditor backing bean, which contains a reference
to the current Widget instance.
Given the code fragment from the Widget class:

Given the code fragment from the Facelet page:

The page displays Conversion Error when a user fills out all the form fields and clicks the Save button.
Which step do you perform to fix this problem?

  • A. Replace Line 1 with:<h: inputText id=createDatevalue=#{widgetEditor.widget.createdDate}converter=java.util.Date/>
  • B. Enclose the code fragment within the <f:view/> tag
  • C. Insert <f:convertDateTime”/> at Line 1
  • D. Replace Line 1 with:<h:inputText id=createDatevalue=#{widgetEditor.widget.createdDate}><f:convertDateTime pattern=dd-mm- yyyy/></h:inputText>
Answer:

D

User Votes:
A
50%
B
50%
C
50%
D 1 votes
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 12

You created two filters for your web application by using the @WebFilter annotation, one for
authorization and the other for narrowing results by the provided search criteria. The authorization
filter must be invoked first.
How can you specify this?

  • A. setting the priority attribute of the @WebFilter annotation for each of the filters
  • B. placing the filter mapping elements in the required order in the web.xml deployment descriptor
  • C. placing @WebFilterMapping annotations in the required order
  • D. specifying the filter precedence order by using the @Priority annotation
Answer:

A

User Votes:
A 1 votes
50%
B
50%
C
50%
D 1 votes
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 13

Which of these can be a JPA entity?

  • A. Enum type
  • B. Abstract class
  • C. Interface type
  • D. Final class
Answer:

A

User Votes:
A 1 votes
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 14

Which two features are provided by the JSTL Core library for a JSP? (Choose two.)

  • A. iteration over a collection
  • B. buffering of large result sets
  • C. testing conditions
  • D. message localization
Answer:

A,D


Explanation:
Reference:
https://www.journaldev.com/2090/jstl-tutorial-jstl-tags-example

User Votes:
A 1 votes
50%
B
50%
C
50%
D 1 votes
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 15

How can a servlet indicate to the browser that cookie data should be sent over a secure connection?

  • A. Call the getSecure(true) method on the cookie object.
  • B. Encrypt the cookie data. The browser automatically sends encrypted data over a secure connection.
  • C. Set the ENCRYPT header in the response.
  • D. Configure SessionTrackingMode.SSL on the ServletContext object.
Answer:

A


Explanation:
Reference:
https://docs.oracle.com/javaee/6/api/?javax/servlet/http/Cookie.html

User Votes:
A 1 votes
50%
B 1 votes
50%
C
50%
D 1 votes
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000
To page 2