Quiz 9
Quiz 9
Question 1 (1 point)
Saved
The annotations:
@Produces( MediaType.APPLICATION_JSON)
@Consumes( MediaType.APPLICATION_JSON)
will let the system know you are planning to use JSON for your
method.
Question 3 (1 point)
Saved
The annotation @RolesAllowed must be used on a method to
define roles that can access it. It cannot be replaced or used
in conjunction with programmatic role setup.
Question 3 options:
a) True
b) False
Question 4 (1 point)
Saved
What is/are true regarding MessageHolder?
Select 3 correct answer(s)
Question 4 options:
b) The internal variables/methods inside MessageHolder represent what the final JSON will look like.
c) Names provided on the getters will affect the final names of JSON fields.
d) Instance of MessageHolder is the message that will be sent back to client in JSON format.
Question 5 (1 point)
Saved
Which annotation is needed to define the main path of your
REST application?
Question 5 options:
Question 6 (1 point)
Saved
Annotation @Path can be placed on what?
Question 6 options:
a) Class
b) Variables or fields
c) Method
Question 7 (1 point)
Saved
This is the primary class of a REST application. What is
missing?
public class RestMain {
Question 7 options:
a) extends javax.ws.rs.core.Application
b) extends javafx.application.Application
c) No extends is needed.
d) implements jakarta.ws.rs.core.Application
Question 8 (1 point)
Saved
In what class do we need to add @DeclareRoles to declare
the roles we will use in our REST application?
Question 8 options:
Question 9 (1 point)
Saved
When defining a sub resource like below:
@GET
@Path("{resourceId}")
/*some code*/
a) Nothing
b) @PathParam("resourceId")
Question 10 (1 point)
Saved
The class MessageHolder must always be created with the
exact variables below:
protected String theMessage;
protected LocalDateTime date;
Question 10 options:
a) True
b) False