Building a RESTful Web Service :: Learn how to create a RESTful web service with Spring. :: spring-boot http://spring.io/guides/gs/rest-service/

HelloWorldConfiguration.java 567B

12345678910111213141516171819
  1. package hello;
  2. import org.springframework.bootstrap.SpringApplication;
  3. import org.springframework.bootstrap.context.annotation.EnableAutoConfiguration;
  4. import org.springframework.context.annotation.ComponentScan;
  5. import org.springframework.context.annotation.Configuration;
  6. import org.springframework.web.servlet.config.annotation.EnableWebMvc;
  7. @Configuration
  8. @EnableAutoConfiguration
  9. @EnableWebMvc
  10. @ComponentScan
  11. public class HelloWorldConfiguration {
  12. public static void main(String[] args) {
  13. SpringApplication.run(HelloWorldConfiguration.class, args);
  14. }
  15. }