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:
- 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.
- 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
Get step-by-step solutions from verified subject matter experts
