Consume RESTful web service using jQuery based on Spring which is one of framework of java that is based eclipse. This project is a purpose for class project as of blueprint for consumming RESTful web service using jQuery based on Spring Framework
Open your favorite Java IDE, in our case we use Spring Tool Suit 4. If you want to use other IDE, you may need additional configuration.
Import the Project as Gradle project from the IDE.
Run the Project as Run As
> Spring Boot App
After successfully build with Step 3
action, open your favorite browser and search http://localhost:8080/
and press Enter
After this, you can use postman or the web browser to see the result. To use the web browser see Step 4
. To use the postman see below steps.
Run the Project as Run As
> Spring Boot App
Open postman and go to the request page and follow the CRUD
form to request the the server.
- To Create a user ->
POST http://localhost:8080/api/user
- To Read a user ->
GET http://localhost:8080/api/user/{id}
- To Read all user ->
GET http://localhost:8080/api/user
- To Update a user ->
PUT http://localhost:8080/api/user/{id}
- To Delete a user ->
DELETE http://localhost:8080/api/user/{id}
-
Click Here(
Right click and press new tab, to open on new tab -> To keep the current tab.
) to see the overal documentation of the project -
src/main/java/com/ws/webservicewithjQuery/*.java
is the file that the java part of the code is written. -
src/main/resources/static/*
is the the folder that holds the markup files likehtml
andjs
files. -
src/test/java/com/ws/webservicewithjQuery/WebserviceWithJQueryApplicationTests.java
is a file that is used to test the java code functionality. Unfortunately, there is not test case coded. Sorry for that 🥺 -
The gradle part inicates the project is done by gradle-groovy not marvel.
You can use this project and modify as you wanted. You can see the LICENSE.