Sign In
Home/Oracle/1z0-900/Free questions

1z0-900 — Free Practice Questions

10 free sample questions from a bank of 63, with the correct answers and explanations. No signup required — start practising right now.

1You need to develop a chat application, which allows the display of emoticons and images together with text messages. How should you configure a WebSocket endpoints to receive both text and binary messages?
  • Create two @onMessage methods in the same endpoint with appropriate parameter types.
  • Define the @onMessage methods in your endpoint with Object as parameter and check the actual type in your code.
  • You can achieve this only by creating separate WebSocket endpoints for each message type.
  • Create two @onMessage methods, each with appropriate decoder attribute in the same endpoint.
Answer: A
2Given the code fragment from a Facelet page: On Line 1, you ae asked to insert a search box that displays the text "Search Here" via a placeholder. Assume searchMB is a valid Managed Bean. Which two options enable you to create a search box with a placeholder attribute on Line 1? (Choose two.)
1z0-900 question 2
    Answer:
    3Given the code fragment: Which method should be used on line 3 to enable default validation mechanism?
    1z0-900 question 3
    • u.setProperty(String, Object)
    • u.setProperty(Schema)
    • u.setEventHandler(ValidationEventHandler)
    • u.setAdapter(XmlAdapter)
    Answer: D
    4How do you specify a default error page in your web.xml file?
    • /general-error.html
    • * /general-error.html
    • * /general-error.html
    • /general-error.html
    Answer: B
    5Given 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.)
    1z0-900 question 51z0-900 question 5
    • Replace line 2 with: @Inject public void setAcc(Account acc)
    • Replace line 3 with: @Inject public Account getAcc()
    • Replace line 1 with: @Inject private Account acc;
    • Replace line 3 with: public @Inject Account getAcc()
    • Replace line 1 with: private @Inject Account acc;
    • Replace line 2 with: public void setAcc(@Inject Account acc)
    Answer: D, F
    6Given: How often does the submitted task run?
    1z0-900 question 6
    • need more details to determine
    • once
    • as many times as you like
    • based on a schedule
    Answer: A
    7Given: What code needs to be added to line 1 for MyMapper bean instances to be correctly passivated?
    1z0-900 question 7
    • @Stateless @PassivationCapable
    • @Stateless
    • @Stateful @PassivationCapable
    • @Stateful
    Answer: D
    8Which URL represents an invalid approach to pass a parameter to a REST resource?
    • /Employees?value=1
    • /Employees&value=1
    • /Employees/1
    • /Employees;value=1
    Answer: D
    9Given: If an exception is thrown inside the if block, what effect will it have on the transaction?
    1z0-900 question 9
    • The transaction will be committed.
    • The transaction will be suspended.
    • The transaction will be rolled back.
    Answer: C
    10Given the code fragments: What code should you add to the body of the updateEmployee method in order to save pending changes to the database?
    1z0-900 question 10
    • entityManager.merge(emp);
    • Context. Ctx = new InitialContext(); UserTransaction utx = (UserTransaction)ctx.lookup("java:comp/UserTransaction"); utx.begin(); entityManager.merge(emp); utx.commit();
    • entityManager.lock(emp); EntityManager.merge(emp);
    • entityManager.getTransaction().begin(); entityManager.merge(emp); entityManager.getTransaction().commit();
    Answer: B

    Want the full bank of 63 questions for 1z0-900? See all practice exams.