Exchange account: 2318645572
Description
Development tools: Eclipse
development system: Windows 7
Development specification: MAVEN Project
Note: Follow the way I say
1. Guide Package: Pom.xml
<project xmlns= "http://maven.apache.org/POM/4.0.0" xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance" xsi: schemalocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" > < Modelversion>4.0.0</modelversion> <groupId>cn.tedu</groupId> <artifactid>springboot2 </artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</packaging> <name > springboot2</name> <parent> <groupId>org.springframework.boot</groupId> <artifact Id>spring-boot-starter-parent</artifactid> <version>1.3.3.RELEASE</version><!--Lookup Parent from repository-</parent> <properties> <project.build.sourceencoding>utf-8& Lt;/project.build.sourceencoding> <project.reporting.outputencoding>utf-8</ Project.reporting.outputencoding> <java.version>1.8</java.version> </propertiEs> <dependencies><dependency> <groupId>org.springframework.boot</groupId> < Artifactid>spring-boot-starter-web</artifactid> <version>1.3.3.RELEASE</version> < Classifier>sources</classifier></dependency> </dependencies> </project>
2. Create Application.java
Package Controller; Import org.springframework.boot.SpringApplication; Import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication Public class Application { publicstaticvoid main (string[] args) { Springapplication.run (Application. class , args);} }
3. Create Hellospringboot.java
Package Controller;import org.springframework.web.bind.annotation.requestmapping;import Org.springframework.web.bind.annotation.RestController; @RestControllerpublic class Hellospringboot { @ Requestmapping (value = "/") String Index () { return "Hello Spring boot!" ; } @RequestMapping (value= "/back") String Demo1 () {return ' JJJJJ ';}}
4. Start Application.java
You can right-click Start in Debug
5, acceptance
Open Browser, enter http://localhost:8080/
Spring_boot Raiders 1.1-hello Springboot