1.打开Eclipse新建maven项目

2.导入maven依赖

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.1.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>

3.项目新建完成

4.new package and new class

5.copy示例:https://github.com/spring-projects/spring-boot

package xiaobing.springboot.controller;

import org.springframework.boot.*;
import org.springframework.boot.autoconfigure.*;
import org.springframework.web.bind.annotation.*; @RestController
@SpringBootApplication
public class Example { @RequestMapping("/")
String home() {
return "Hello World!";
} public static void main(String[] args) {
SpringApplication.run(Example.class, args);
} }

6.启动项目

  .   ____          _            __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.0.1.RELEASE) 2019-11-02 23:36:46.301 INFO 6576 --- [ main] xiaobing.springboot.controller.Example : Starting Example on PC-20190411SFOQ with PID 6576 (D:\Eclipse_workspace_springboot\xiaobing.springboot\target\classes started by Administrator in D:\Eclipse_workspace_springboot\xiaobing.springboot)
2019-11-02 23:36:46.316 INFO 6576 --- [ main] xiaobing.springboot.controller.Example : No active profile set, falling back to default profiles: default
2019-11-02 23:36:46.868 INFO 6576 --- [ main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@1d548a08: startup date [Sat Nov 02 23:36:46 CST 2019]; root of context hierarchy
2019-11-02 23:36:57.008 INFO 6576 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2019-11-02 23:36:57.124 INFO 6576 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2019-11-02 23:36:57.126 INFO 6576 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.29
2019-11-02 23:36:57.172 INFO 6576 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jre1.8.0_211\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_211/bin/server;C:/Program Files/Java/jre1.8.0_211/bin;C:/Program Files/Java/jre1.8.0_211/lib/amd64;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.8.0_211\bin;C:\Program Files\Java\jdk1.8.0_211\jre\bin;C:\Program Files\VisualSVN Server\bin;D:\TortoiseSVN\bin;C:\Program Files (x86)\Tesseract-OCR;D:\apache-maven-3.6.0\apache-maven-3.6.0\bin;D:\allure\allure-2.12.1\bin;D:\android-sdk-windows-appium\platform-tools;D:\android-sdk-windows-appium\tools;;D:\eclipse\eclipse;;.]
2019-11-02 23:36:58.428 INFO 6576 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2019-11-02 23:36:58.429 INFO 6576 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 11571 ms
2019-11-02 23:36:58.932 INFO 6576 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet mapped to [/]
2019-11-02 23:36:58.949 INFO 6576 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2019-11-02 23:36:58.950 INFO 6576 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2019-11-02 23:36:58.951 INFO 6576 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2019-11-02 23:36:58.951 INFO 6576 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2019-11-02 23:36:59.377 INFO 6576 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2019-11-02 23:37:00.238 INFO 6576 --- [ main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@1d548a08: startup date [Sat Nov 02 23:36:46 CST 2019]; root of context hierarchy
2019-11-02 23:37:00.541 INFO 6576 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/]}" onto java.lang.String xiaobing.springboot.controller.Example.home()
2019-11-02 23:37:00.558 INFO 6576 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2019-11-02 23:37:00.561 INFO 6576 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2019-11-02 23:37:00.754 INFO 6576 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2019-11-02 23:37:00.755 INFO 6576 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2019-11-02 23:37:01.504 INFO 6576 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2019-11-02 23:37:01.772 INFO 6576 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2019-11-02 23:37:01.788 INFO 6576 --- [ main] xiaobing.springboot.controller.Example : Started Example in 17.112 seconds (JVM running for 18.461)

7.访问项目

2019-11-02 23:41:20.516  INFO 6576 --- [nio-8080-exec-3] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring FrameworkServlet 'dispatcherServlet'
2019-11-02 23:41:20.517 INFO 6576 --- [nio-8080-exec-3] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization started
2019-11-02 23:41:20.572 INFO 6576 --- [nio-8080-exec-3] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization completed in 55 ms

sprint boot 手动快速创建web应用(2)的更多相关文章

  1. Spring Boot入门-快速搭建web项目

    Spring Boot 概述: Spring Boot makes it easy to create stand-alone, production-grade Spring based Appli ...

  2. 用Spring Boot零配置快速创建web项目(1)

    一.Spring Boot简介 Spring Boot是由Pivotal团队提供的全新框架,其设计目的是用来简化新Spring应用的初始搭建以及开发过程.该框架使用了特定的方式来进行配置,从而使开发人 ...

  3. Spring Boot的快速创建

    一.利用向导快速搭建Spring Boot应用 创建一个controller package com.hoje.springboot.Controller; import org.springfram ...

  4. INDIGO STUDIO神器!快速创建WEB、移动应用的交互原型工具【转】

    转自:http://www.uisdc.com/indigo-studio-wireframe-interactive-uis 这套最新的设计工具出自Indigo工作室,永久免费,有mac版本和WIN ...

  5. Spring Boot 框架 - 快速创建Spring Boot应用

    使用Spring的项目创建向导创建一个Spring Boot项目 创建完成目录 目录文件说明: 主启动程序已生成 resources文件夹中目录结构 static:保存所有的静态资源,例如js,css ...

  6. 使用npm init快速创建web 应用

    一般来说我们会有npm init -y 快速生成package.json 文件, 但是npm init 可以使用脚手架工具,生成项目,比较方便 参考 npm init 帮助命令 npm init [- ...

  7. 初步认识express,并创建web服务器,挂载静态资源

    1.Express简介 1.1什么是Express 官方给出的概念:Express 是基于 Node.js 平台,快速.开放.极简的 Web 开发框架,官方网址 相似用途:Express 的作用和 N ...

  8. Spring Boot-初学01 -使用Spring Initializer快速创建Spring Boot项目 -@RestController+spEL -实现简单SpringBoot的Web页面

    1.IDEA:使用 Spring Initializer快速创建项目 IDE都支持使用Spring的项目创建向导快速创建一个Spring Boot项目: 选择我们需要的模块:向导会联网创建Spring ...

  9. JAVA WEB快速入门之从编写一个基于SpringBoot+Mybatis快速创建的REST API项目了解SpringBoot、SpringMVC REST API、Mybatis等相关知识

    JAVA WEB快速入门系列之前的相关文章如下:(文章全部本人[梦在旅途原创],文中内容可能部份图片.代码参照网上资源) 第一篇:JAVA WEB快速入门之环境搭建 第二篇:JAVA WEB快速入门之 ...

随机推荐

  1. Jmeter系列(7)- 分析源码,创建下单、用户注销接口请求

    源码分析 下单 用户注销 创建请求 下单 用户注销 请求调整 将信息头管理器从[02.浏览订单]请求中抽出来就变成公用的.[03,04]请求不需要单独再加信息头管理器 DeBug取样器 添加DeBug ...

  2. php--laravel --debug--mac

    1>安装debug 一.下载xdebug文件 1.将phpinfo();的信息全部输入网址中的框,得到适配的xdebug版本: 网址:http://xdebug.org/wizard.php 2 ...

  3. centos7 .net core 使用supervisor守护进程后台运行

    安装supervisor yum install supervisor 配置supervisor vi /etc/supervisord.conf 拉到最后,这里的意思是 /etc/superviso ...

  4. 鸿蒙内核源码分析(进程回收篇) | 老父亲如何向老祖宗临终托孤 ? | 百篇博客分析OpenHarmony源码 | v47.01

    百篇博客系列篇.本篇为: v47.xx 鸿蒙内核源码分析(进程回收篇) | 临终前如何向老祖宗托孤 | 51.c.h .o 进程管理相关篇为: v02.xx 鸿蒙内核源码分析(进程管理篇) | 谁在管 ...

  5. Angular 的性能优化

    目录 序言 变更检查机制 性能优化原理 性能优化方案 小结 参考 序言 本文将谈一谈 Angular 的性能优化,并且主要介绍与运行时相关的优化.在谈如何优化之前,首先我们需要明确什么样的页面是存在性 ...

  6. 轻量级 Java 基础开发框架,Solon & Solon Cloud 1.5.40 发布

    Solon 已有120个生态扩展插件,此次版本以细节打磨为主: 增加 mybatisplus-solon-plugin 插件 //至此,Solon 已完成国内外主流的5个ORM框架插件适配 插件 so ...

  7. 【vue】两个页面间传参 - props

    目录 Step1 设置可以 props 传递数据 Step2 跳转前页面中传递数据 Step3 跳转后的页面接收数据 从 A 页面跳转到 B 页面, 参数/数据通过 props 传递到 B 页面,这种 ...

  8. oracle扩展表空间

    1.  查看表空间的名字及文件所在的位置 select tablespace_name, file_id, file_name, round(bytes / (1024 * 1024), 0) tot ...

  9. Conda 命令

    Conda 命令 1 检验当前conda的版本 conda -V 2 conda常用的命令 查看已有的虚拟环境 conda env list 创建虚拟环境和删除虚拟环境 anaconda命令创建pyt ...

  10. bash手册

    目录 bash手册 man命令 man man 分页程序(page) Linux手册页惯用的节名 Linux手册页的内容区域 查看命令在Linux手册页中的区域 info页面 help帮助 bash手 ...