SpringBoot2中环境搭建方法
发表于:2024-10-21 作者:千家信息网编辑
千家信息网最后更新 2024年10月21日,本篇文章为大家展示了SpringBoot2中环境搭建方法,内容简明扼要并且容易理解,绝对能使你眼前一亮,通过这篇文章的详细介绍希望你能有所收获。导包 org.springframework.boot spring-boot-starter-parent 2.1.6.RELEASE org.springframework.boot spring-boot-starter-web
启动类
package com.zz;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;/** * 右键--》run as application 运行正启动类的main方法,就可以启动这个springboot项目。SpringBoot 自带了 tomcat, 运行这个main方法 的时候,会同时启动tomcat * @author jiyu * */@SpringBootApplicationpublic class App { public static void main(String[] args) { // TODO Auto-generated method stub SpringApplication.run(App.class, args); }}
右键-》run as application 运行正启动类的main方法,就可以启动这个springboot项目。SpringBoot 自带了 tomcat, 运行这个main方法 的时候,会同时启动tomcat启动成功的日志 . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.1.6.RELEASE)2019-08-03 21:27:18.453 INFO 16564 --- [ main] com.zz.App : Starting App on DESKTOP-9FM4ENL with PID 16564 (C:\bsea\wp\2019\07\02\SpringBoot2\SpringBootBasic\target\classes started by jiyu in C:\bsea\wp\2019\07\02\SpringBoot2\SpringBootBasic)2019-08-03 21:27:18.460 INFO 16564 --- [ main] com.zz.App : No active profile set, falling back to default profiles: default2019-08-03 21:27:21.273 INFO 16564 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)2019-08-03 21:27:21.342 INFO 16564 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]2019-08-03 21:27:21.343 INFO 16564 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.21]2019-08-03 21:27:21.496 INFO 16564 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext2019-08-03 21:27:21.496 INFO 16564 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 2926 ms2019-08-03 21:27:21.736 INFO 16564 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'2019-08-03 21:27:21.947 INFO 16564 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''2019-08-03 21:27:21.950 INFO 16564 --- [ main] com.zz.App
测试controllerpackage com.zz.controller;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RestController;@RestControllerpublic class TestController { @RequestMapping("hello") public String t1(){ return "hello SpringBoot"; }}
测试
添加 热启动功能
STS 或者Eclipse 只需要在pom文件加入一个包,就可以实现热启动
org.springframework.boot spring-boot-devtools true
上述内容就是SpringBoot2中环境搭建方法,你们学到知识或技能了吗?如果还想学到更多技能或者丰富自己的知识储备,欢迎关注行业资讯频道。
方法
运行
环境
内容
同时
技能
时候
知识
项目
测试
简明
成功
简明扼要
功能
就是
文件
文章
日志
更多
篇文章
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
长岛软件开发公司
如何用代码修改数据库
租用服务器的主要用途
复试课只有数据库原理的学校
网易版为什么搜不到服务器号
高考网络技术考试重点
pg数据库完全删除
查询数据库信息有多少条
cdh部署关系型数据库
荣创互联网科技有限公司
关系数据库中的一行叫做什么
查重数据库
数据库开发管理技巧
ssh项目数据库密码修改
数据库新标准
顺应网络技术发展趋势
50岁还能做软件开发吗
软件开发公司技术入股合同
互联网科技热榜
数据库php
如何获得seer数据库
选择网络安全方向的理由
苏宁互联网科技观
如何安装dell服务器
惠普网络安全密钥不正确
铜川软件开发设计
360网络安全需求
涉及网络安全密码的书籍
幻塔被遗弃的服务器pdc1
数据库原理及应用章节测试答案