Question: Annotate the following resource class, using JAX-RS annotations, to reflect that: The URI for a student resource has the form /rest/student/ cwid and the resource

Annotate the following resource class, using JAX-RS annotations, to reflect that:

  1. The URI for a student resource has the form /rest/student/cwid and the resource is represented as an XML document. A representation for this resource can be obtained using the GET verb.
  2. The URI for the resource of all students has the form /rest/student. A list of all student records can be obtained by performing GET on this resource. A new student record is added by performing the POST operation on this resource. The representation for the new student should be represented in XML. A student record is updated by performing a PUT operation on the student resource.

public class StudentResource { public void add(Student s) { ... }; public Student retrieve(long cwid) { ... }; public void update(String cwid, Student s) { ... }; public Student[] retrieveAll() { ... }; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!