Spring_boot Raiders 1.1-hello Springboot

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.