| 
									
										
										
										
											2013-06-03 17:54:58 +03:00
										 |  |  | ========= | 
					
						
							| 
									
										
										
										
											2013-07-02 13:54:41 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-25 19:39:04 +03:00
										 |  |  | ## REST Example Project with Spring
 | 
					
						
							| 
									
										
										
										
											2013-07-02 13:54:41 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-28 12:37:34 +03:00
										 |  |  | ### Courses
 | 
					
						
							|  |  |  | The "REST With Spring" Classes: http://bit.ly/restwithspring | 
					
						
							| 
									
										
										
										
											2016-06-28 12:38:19 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-12 17:02:35 +03:00
										 |  |  | The "Learn Spring Security" Classes: http://github.learnspringsecurity.com | 
					
						
							| 
									
										
										
										
											2013-07-02 13:54:41 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-07-14 14:21:30 +03:00
										 |  |  | ### Relevant Articles: 
 | 
					
						
							| 
									
										
										
										
											2018-05-02 13:11:09 +05:30
										 |  |  | - [REST Pagination in Spring](http://www.baeldung.com/rest-api-pagination-in-spring) | 
					
						
							| 
									
										
										
										
											2018-05-06 19:15:23 +05:30
										 |  |  | - [HATEOAS for a Spring REST Service](http://www.baeldung.com/rest-api-discoverability-with-spring) | 
					
						
							| 
									
										
										
										
											2018-05-02 13:11:09 +05:30
										 |  |  | - [REST API Discoverability and HATEOAS](http://www.baeldung.com/restful-web-service-discoverability) | 
					
						
							| 
									
										
										
										
											2018-05-06 19:15:23 +05:30
										 |  |  | - [ETags for REST with Spring](http://www.baeldung.com/etags-for-rest-with-spring) | 
					
						
							| 
									
										
										
										
											2018-05-02 13:11:09 +05:30
										 |  |  | - [Integration Testing with the Maven Cargo plugin](http://www.baeldung.com/integration-testing-with-the-maven-cargo-plugin) | 
					
						
							| 
									
										
										
										
											2018-05-06 19:15:23 +05:30
										 |  |  | - [Introduction to Spring Data JPA](http://www.baeldung.com/the-persistence-layer-with-spring-data-jpa) | 
					
						
							|  |  |  | - [Project Configuration with Spring](http://www.baeldung.com/project-configuration-with-spring) | 
					
						
							| 
									
										
										
										
											2016-02-10 13:42:54 +02:00
										 |  |  | - [Metrics for your Spring REST API](http://www.baeldung.com/spring-rest-api-metrics) | 
					
						
							| 
									
										
										
										
											2016-02-10 14:13:27 +02:00
										 |  |  | - [Spring RestTemplate Tutorial](http://www.baeldung.com/rest-template) | 
					
						
							| 
									
										
										
										
											2017-04-09 10:43:50 +03:00
										 |  |  | - [Bootstrap a Web Application with Spring 4](http://www.baeldung.com/bootstraping-a-web-application-with-spring-and-java-based-configuration) | 
					
						
							| 
									
										
										
										
											2018-05-02 13:11:09 +05:30
										 |  |  | - [Build a REST API with Spring 4 and Java Config](http://www.baeldung.com/building-a-restful-web-service-with-spring-and-java-based-configuration) | 
					
						
							|  |  |  | - [Error Handling for REST with Spring](http://www.baeldung.com/exception-handling-for-rest-with-spring) | 
					
						
							| 
									
										
										
										
											2017-04-18 22:20:20 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-07-14 14:21:30 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-07-02 13:54:41 +03:00
										 |  |  | ### Build the Project
 | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | mvn clean install | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-12-18 12:48:44 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | ### Set up MySQL
 | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | mysql -u root -p  | 
					
						
							|  |  |  | > CREATE USER 'tutorialuser'@'localhost' IDENTIFIED BY 'tutorialmy5ql';
 | 
					
						
							|  |  |  | > GRANT ALL PRIVILEGES ON *.* TO 'tutorialuser'@'localhost';
 | 
					
						
							|  |  |  | > FLUSH PRIVILEGES;
 | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-07-02 13:54:41 +03:00
										 |  |  | ### Use the REST Service
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ``` | 
					
						
							| 
									
										
										
										
											2017-10-25 19:39:04 +03:00
										 |  |  | curl http://localhost:8080/spring-rest-full/foos | 
					
						
							| 
									
										
										
										
											2013-07-02 13:54:41 +03:00
										 |  |  | ``` |