oracle 1z0-900 practice test

Exam Title: Java EE 7 Application Developer

Last update: Dec 07 ,2025
Question 1

Given the code fragment:

Which method should be used on line 3 to enable default validation mechanism?

  • A. u.setProperty(String, Object)
  • B. u.setProperty(Schema)
  • C. u.setEventHandler(ValidationEventHandler)
  • D. u.setAdapter(XmlAdapter)
Answer:

D


Explanation:
Reference:

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 2

How do you specify a default error page in your web.xml file?

  • A. <on-error><location>/general-error.html<location></on-error>
  • B. <error-page><error-code>*</error-code><location>/general-error.html</location></error-page>
  • C. <on-error><error-code>*</error-code><location>/general-error.html</location></on-error>
  • D. <error-page><location>/general-error.html</location></error-page>
Answer:

B


Explanation:
Reference:

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 3

Given the code fragment:

And

Which two steps, when performed independently, enable the index.xhtml page to print the following
text: The Id is 12345? (Choose two.)

  • A. Replace line 2 with: @Inject public void setAcc(Account acc)
  • B. Replace line 3 with: @Inject public Account getAcc()
  • C. Replace line 1 with: @Inject private Account acc;
  • D. Replace line 3 with: public @Inject Account getAcc()
  • E. Replace line 1 with: private @Inject Account acc;
  • F. Replace line 2 with: public void setAcc(@Inject Account acc)
Answer:

D,F


vote your answer:
A
B
C
D
E
F
A 0 B 0 C 0 D 0 E 0 F 0
Comments
Question 4

Given:

How often does the submitted task run?

  • A. need more details to determine
  • B. once
  • C. as many times as you like
  • D. based on a schedule
Answer:

A


vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 5

: 15
Given:

What code needs to be added to line 1 for MyMapper bean instances to be correctly passivated?

  • A. @Stateless @PassivationCapable
  • B. @Stateless
  • C. @Stateful @PassivationCapable
  • D. @Stateful
Answer:

D


Explanation:
Reference:

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 6

Which URL represents an invalid approach to pass a parameter to a REST resource?

  • A. <base-url>/Employees?value=1
  • B. <base-url>/Employees&value=1
  • C. <base-url>/Employees/1
  • D. <base-url>/Employees;value=1
Answer:

D


vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 7

Given:

If an exception is thrown inside the if block, what effect will it have on the transaction?

  • A. The transaction will be committed.
  • B. The transaction will be suspended.
  • C. The transaction will be rolled back.
Answer:

C


vote your answer:
A
B
C
A 0 B 0 C 0
Comments
Question 8

Given the code fragments:

What code should you add to the body of the updateEmployee method in order to save pending
changes to the database?

  • A. entityManager.merge(emp); B. Context. Ctx = new InitialContext();UserTransaction utx = (UserTransaction)ctx.lookup(“java:comp/UserTransaction”);utx.begin();entityManager.merge(emp);u tx.commit();С. entityManager.lock(emp);EntityManager.merge(emp); C. entityManager.getTransaction().begin();entityManager.merge(emp);entityManager.getTransaction(). commit();
Answer:

B


vote your answer:
A
A 0
Comments
Question 9

When handling a JSF request, your application code decided to redirect the call to another URL by
using HTTP redirect. Which action should you take to correctly complete the handling of the JSF life
cycle?

  • A. Set the immediate=“true” attribute on the command button that was used to perform this call.
  • B. Invoke the dispatch() method on the ExternalContext object.
  • C. Invoke the setCurrentPhaseId(RENDER_RESPONSE) method on the FacesContext object.
  • D. Invoke the responseComplete() method on the FacesContext object.
Answer:

C


vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 10

Given the code fragment:

When the context root is requested
http://host:port/context
, how does the container resolve this
mapping?

  • A. thirdServlet handles the request.
  • B. firstServlet handles the request.
  • C. The container throws an error at startup.
  • D. secondServlet handles the request.
Answer:

C


vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Page 1 out of 14
Viewing questions 1-10 out of 142
Go To
page 2