6 ms·
I did try and build your code to run the test (I've no idea where the CsvParam and DateParam classes come from) but I think that the following will give you wha
by beamso 15y ago
I did try and build your code to run the test (I've no idea where the CsvParam and DateParam classes come from) but I think that the following will give you what you want without throwing the exception.
@DELETE
@Path("{uid: [0-9]+}")
public Response deleteStudent(@PathParam("uid") int uid) {
final Student deletedStudent = STUDENTS.remove(uid);
if (deletedStudent == null) {
return Response.status(Response.Status.NOT_FOUND).build();
} else {
return Response.ok().entity(true).build();
}
}
- smanek 15y agoAh, I see what you mean - thanks! The full (buildable) source code - including the CsvParam and DateParam classes - are here: https://github.com/smanek/students https://github.com/smanek/students