From the course: Building RESTful Web Services with DropWizard

Unlock this course with a free trial

Join today to access over 22,500 courses taught by industry experts.

Syntax of the resource class

Syntax of the resource class

- [Instructor] Okay, so we're going to keep working on our application by doing the resource class this time. So what you want to do is go inside of the resource folder right here and then create a brand new file. So we're going to go and click on New File, testResources.java, like so. So now right away, we have the package that is set for us. And we're going to import a few things. So let's go ahead and start importing. The first one, we're going to import, io.dropwizard.api.Saying, like so. And then we're going to import the resources that will allow us to do posts, get posts and delete endpoints. So let's go ahead and do that. So we're going to import first, javax.ws.rs.GET like so. And then let's copy that line, we're going to basically do a couple of lines like this. So let's do Path at the end here, like so. And then let's again import the same thing and then this time is Produce. And this time,…

Contents