官网在线springboot的搭建
官网在线springboot项目的搭建
springboot 简介:
对于Java语言来说,现在市场上最流行的框架是SSM(springMVC+spring+mybatis)。但是SSM搭建的过程中,比较复杂!springboot的出现,大大加快了SSM框架搭建速度!而且其简化的代码,简化的配置,简化的监控,简化的部署!让我们对springboot爱不释手!相当于SSM的手工的,而springboot是自动的!
一、官网创建springboot项目
1.打开官网https://start.spring.io/
2、解压下载的zip文件到指定的工作目录
3、使用idea或者eclipse,以导入maven项目的方式导入刚刚解压开的项目。
4、添加一个简单的controller
package com.example.demo.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HelloController {
@RequestMapping("/hello")
public String hello() {
return "hello!this is my first Springboot project";
}
}
6.运行DemoApplication的main方法,打开浏览器http://localhost:8080/hello