一、注解
       @SpringBootApplication:Spring Boot项目的核心注解,主要目的是开启自动配置。
       @Configuration:这是一个配置Spring的配置类
       @Controller:标明这是一个SpringMVC的Controller控制器
 注意:
   SpringBoot相当于内置一个tomcat虚拟机,可以自动将Springboot项目转化为jar文件直接运行,方便快捷,当然也可以放入Tomcat中使用。
二、Pom配置 
 <parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId><version>1.5.2.RELEASE</version>
</parent>

注意:
   Spring boot的项目必须要将parent设置为spring boot的parent,该parent包含了大量默认的配置,大大简化了我们的开发。

 <dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin>

三、实战讲解:

 @Controller
@SpringBootApplication
@Configuration
public class HelloApplication { @RequestMapping("hello")
@ResponseBody
public String hello(){
return "hello world!";
} public static void main(String[] args) {
SpringApplication.run(HelloApplication.class, args);
}
}

注:
    @SpringBootApplication注解必须有,SpringApplication是启动springboot的一个应用程序,同时传入对象和参数

main方法:在main方法中启动一个应用,即:这个应用的入口

IntelliJ IDEA 2017版 SpringBoot的web项目补充的更多相关文章

  1. IntelliJ IDEA 2017版 spring-boot 2.0.3 部署war包项目和jar包项目

    1.建立项目 Java Controller package com.springboot.jsp.controller; import org.springframework.stereotype. ...

  2. IntelliJ IDEA 2017版 spring-boot加载jsp配置详解(详细图文实例)

    一.创建项目 (File--->New-->Project) 2.项目配置内容 3.选择配置项目的Group包名,Artifact项目名称 4.选择项目类型为web类型 5.创建成功,点击 ...

  3. IntelliJ IDEA 2017版 spring-boot基础补充,原理详解

    一.Spring发展史  1.Spring1.x       版本一时代主要是通过XML文件配置bean,在java和xml中不断切换,在学习java web 初期的时候经常使用  2.Spring2 ...

  4. IntelliJ IDEA 2017版 spring-boot与Mybatis简单整合

    一.编译器建立项目 参考:http://www.cnblogs.com/liuyangfirst/p/8372291.html 二.代码编辑 1.建立数据库 /* Navicat MySQL Data ...

  5. IntelliJ IDEA 2017版 spring-boot修改端口号配置把端口号改为8081

    1.修改端口号主要是通过配置文件修改.如图: 完整版配置 ######################################################## ###server 配置信息 ...

  6. IntelliJ IDEA 2017版 SpringBoot徒手书写HelloWorld

    1.打开编译器,选择File---->New---->Project 2.弹出设置界面,选择如图样式的1.2.3 3.设置包名称 4.继续next 5.finish完成即可 6.自动生成目 ...

  7. IntelliJ IDEA 2017版 spring-boot 2.0.5 邮件发送简单实例 (三)

    一.搭建SpringBoot项目 详见此文:https://www.cnblogs.com/liuyangfirst/p/8298588.html 注意: 需要添加mail依赖的包,同时还添加了lom ...

  8. IntelliJ IDEA 2017版 spring-boot 2.0.3 邮件发送搭建,概念梳理 (二)

    第二部分 邮件发送历史   一.第一封邮件   1.1969年10月,世界上的第一封电子邮件    1969年10月世界上的第一封电子邮件是由计算机科学家Leonard K.教授发给他的同事的一条简短 ...

  9. IntelliJ IDEA 2017版 SpringBoot的关闭自动配置和自定义Banner

    一.关闭自动配置 在jar包下找下边的名字    设置关闭自动配置jar    多个的时候配置       二.自定义Banner   (1)网站搜索一个图案.网址:http://patorjk.co ...

随机推荐

  1. egret 配置设置

    修改index.html的时候,要主要template文件夹下的web文件夹也有个index.html,两者控制的不一样 初始安装新建项目后调试这样的情况.重新安装引擎和下载egret安装包安装,默认 ...

  2. JSTL标签库学习记录2-fmt

    fmt的标签为辅助性功能标签 设置编码 <fmt:requestEncoding value=""> 国际化相关 <fmt:setLocale value=&qu ...

  3. pycharm 远程开发

    1. 服务器安装图形化 和 pycharm 本地使用 MobaXterm 工具登陆 session配置 勾选 x11-forwarding 运行pycharm.sh 2. 本地pycharm 远程服务 ...

  4. golang获取IP地址

    ip:=this.Ctx.Request.RemoteAddr ip=ip[0:strings.LastIndex(ip, ":")]

  5. 个人总结-----非贪心算法的图的m着色判断及优化问题

    1.问题描述: 对于著名的图的m着色,有两个主要的问题,一个是图的m色判定问题,一个是图的m色优化问题,描述如下. 图的m色判定问题: 给定无向连通图G和m种颜色.用这些颜色为图G的各顶点着色.问是否 ...

  6. android mapView

    1.Because the Maps library is not a part of the standard Android library, you must declare it in the ...

  7. python笔记之循环控制

    学习python的第一个例子,while循环中嵌套if-else语句,一个猜年龄的例子 #案例1,实现循环猜年龄 # my_age = 12 # while True: # guess_age1 = ...

  8. C#.net随机数函数

    (1)Random rnd = new Random(); int rndNum = rnd.Next();           //int 取值范围内的随机数 int rndNum = rnd.Ne ...

  9. jquery datatables api

    原文地址 学习可参考:http://www.guoxk.com/node/jquery-datatables http://yuemeiqing2008-163-com.iteye.com/blog/ ...

  10. Golang之beego读取配置信息,输出log模块

    1,准备好配置文件 [server] listen_ip = "0.0.0.0" listen_port = [logs] log_level=debug log_path=./l ...