From the course: Java EE 7: Web Services
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Use HTTP GET - Java EE Tutorial
From the course: Java EE 7: Web Services
Use HTTP GET
- [Instructor] GET Resource methods are annotated with the @GET Request Method designator, along with the @Path annotation. To identify the particular method that should process http GET requests. The communication between the calling program, the client, and the service should be stateless. Whatever information that's needed should be passed with each request. A GET Request often times retrieves an entity from the database, as is in our case study. A GET Request like this will be mapped to the method below. A GET Request like this will be mapped to the method below. And a GET Request that looks like this will be mapped to this method below. Let's see this code in action. I've opened the project in IntelliJ, and I've navigated to the ApplicationResource.Java file. MySQL is up and running, and the application's been deployed to the server. So, let's look at our code. Notice, down on line 24, there is the GetAll method. And so, this method simply returns all of the applications in the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.