Spring Boot (教程二:安装spring-tool-suite插件 )

GitHub 地址:

https://github.com/asd821300801/Spring-Boot.git


安装 spring-tool-suite 插件

官网地址:https://spring.io/tools/sts/


简介:


     Spring工具套件是一个基于Eclipse的开发环境,用于开发Spring应用程序。它提供了一个现成的使用环境来实现,调试,运行,和部署你的Spring应用程序,包括关键的TC服务器,Pivotal Cloud Foundry,Git,Maven,AspectJ集成,并在最新的Eclipse版本。 
包括Spring工具套件的开发者版本的关键TC服务器,在下降的Apache Tomcat的优化弹簧。其Spring Insight控制台,TC服务器开发版提供了一个图形化的实时视图的应用程序性能指标,让开发人员识别和诊断问题,从他们的桌面。 
Spring工具套件支持面向本地、虚拟和基于云的服务器的应用程序。它是免费的开发和内部业务操作使用没有时间限制,完全开源和许可下的Eclipse公共许可证条款。


1、官网下载

https://spring.io/tools/sts/

1


2、Eclipse市场下载:


Help->Eclicpse Marketplace


2


搜索 spring-tool-suite


3


Installed 安装……



查看是否安装成功:

Window->Preferences
  • 1


出现Spring选项说明已经安装成功。


4


创建Spring Boot 工程


1、新建Spring Starter Project


5



2、Packaging 选择 jar


6



3、勾选Web 项


7



4、项目结构


8



启动项目


1、创建 HelloController.java


9


package com.example.demo;


import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController 
@RequestMapping("/hello")  
public class HelloController {
    @RequestMapping("/sts")
    public String helloworld(){  
        return "使用spring-tool-suite插件";  
    }  
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14


2、运行 DemoApplication.java文件 或者 右键项目 Run As -> Spring Boot App


10



3、打印输出:Started DemoApplication in 3.977 seconds (JVM running for 6.73) 说明项目启动成功。


11



4、访问网页

http://localhost:8080/hello/sts


12


原文地址:https://blog.csdn.net/gfd54gd5f46/article/details/72824635


猜你喜欢

转载自blog.csdn.net/ywb201314/article/details/80853378