From the course: Spring Boot and React: Build Scalable and Dynamic Web Apps

Unlock the full course today

Join today to access over 24,600 courses taught by industry experts.

Setting up for web

Setting up for web

- [Instructor] So now we're going to take a little bit of a diversion and set up some things in our project that we're going to consume in a later video, but then sort of build the structure of how we would build a web service today. And we need to get that done before we build the intermediate service. So let's jump into code and make that happen. The first thing I want you to do is go to src main java, and underneath your root package I want you to create a new package called web.errors. And we're going to create a couple of new classes in here. So the first one that we're going to create is a NotFoundException. We're going to annotate this with the response status of HttpStatus.NOT_FOUND. We will extend RuntimeException, and I am going to override the first four methods of exception. Now we're going to do the same thing, but we're going to create this one called BadRequestException. This will have a ResponseStatus of…

Contents