springboot-helloworld-eclipse
1、eclipse安装springboot插件
2、new->Spring Start ->group:组名称;artifact:组件名称;->选中web->finish
3、复制pom文件
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <groupId>com.example</groupId>
<artifactId>demo1</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging> <name>demo1</name>
<description>Demo project for Spring Boot</description> <parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.2.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties> <dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency> <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency> </dependencies> <build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build> </project>
4、创建controller
@RestController
//表示该controller类下所有的方法都公用的一级上下文根
@RequestMapping(value = "/springboot")
public class UserController { //这里使用@RequestMapping注解表示该方法对应的二级上下文路径
@RequestMapping(value = "/getUserByGet", method = RequestMethod.GET)
String getUserByGet(@RequestParam(value = "userName") String userName){
return "Hello " + userName;
}
}
5、运行*Application的main方法
6、访问http://localhost:8080/springboot/getUserByGet?userName=a
springboot-helloworld-eclipse的更多相关文章
- Jrebel热部署配置完整教程(IntelliJ IDEA、Jrebel、spring boot、springboot、eclipse、Tomcat)
标签:IntelliJ IDEA.Jrebel.spring boot.springboot.eclipse.Tomcat1.安装插件并激活插件安装参考:http://blog.csdn.net/u0 ...
- spring boot 初试,springboot入门,springboot helloworld例子
因为项目中使用了spring boot ,之前没接触过,所以写个helloworld玩玩看,当做springboot的一个入门例子.搜索 spring boot.得到官方地址:http://proje ...
- springboot在eclipse中运行使用开发配置,打包后运行使用生产环境默认配置
java命令运行springboot jar文件,指定配置文件可使用如下两个参数中其中一个 --spring.config.location=配置文件路径 -Dspring.profiles.acti ...
- SpringBoot系列: Eclipse+Maven环境准备
这个链接比我写得更全面, http://tengj.top/2018/01/01/maven/ =============================20190115补充: maven 的一些插件 ...
- Springboot IDEA eclipse 打包
在开发springboot项目中,我们会进行打包发布项目,springboot推荐以jar包方式发布,相对之下 jar运行的效率比起war项目快很多. 打包切记: 1.查看项目里面有没有其他的main ...
- 【Android】4.0 神一样的仪式感:Android第一个项目HelloWorld——eclipse
进入Eclipse,在左侧栏右击: 新建 “Android Application Project”项目,如果new之后没有,选择“Project”中“Android”目录下的 “Android Ap ...
- springboot在eclipse实现热部署
eclipse使用spring-tool-suite插件创建springboot项目,项目创建完成后. 选中项目,右键 Spring Tools --> Add Boot Devtools 点 ...
- SpringBoot——HelloWorld
微服务和单体应用的宏观理解 微服务:一组小型应用通过HTTP的方式进行沟通的开发思想 单体应用:ALL IN ONE 单体应用的不足: 随着业务逻辑的不断更新和迭代开发,起初的小型应用会不断膨胀,当应 ...
- SpringBoot从Eclipse添加的Tomcat容器中启动
SpringBoot的Web项目,想要在Eclipse中的Tomcat容器中启动运行需要做下面这两处改动 pom.xml <packaging>war</packaging> ...
- Springboot helloworld入门最经典例子
一.建立maven java项目 导入springboot包 二.配置pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0 ...
随机推荐
- python+Appium自动化:屏幕截图
屏幕截图 主要是为了程序出现错误时,开发除了可以分析日志之外,还可以进行截图更好地去定位问题. 截图一般有两种方法: 第一种save_screenshot(self,filename) driver. ...
- C# HttpClient使用 网络(一)
一.异步调用web服务 GetAsync() static void Main(string[] args) { Console.WriteLine("In main before cal ...
- avcodec_decode_video2函数
转自 https://www.xuebuyuan.com/2156374.html 该函数的作用是实现压缩视频的解码.在avcodec.h中的声明方式如下: int avcodec_decode_vi ...
- 使用Jieba提取文章的关键词
import jieba.analyse as analyse import matplotlib.pyplot as plt from wordcloud import WordCloud data ...
- conda 激活环境失败解决办法
https://stackoverflow.com/questions/41746137/conda-environment-is-discoverable-but-not-activateable- ...
- XCTest-iOS单元测试框架
Xctest 是iOS的单元测试框架,有objective-c和swift两种语言可以选择 Xcuitest 是iOS的UI测试框架 XCTest 官方文档地址:https://devel ...
- typedef void (*funcptr)(void)的含义
fun a;//等价于void (*a)(); 这样声明起来就方便多了 void (*a)();表示a是个指针,指向一个不带参数.返回值为空的函数 定义一个函数指针类型. 比如你有三个函数: void ...
- ASCII码,unicode码,UTF8编码,UTF16编码\ud842\udfb7
汉字转为unicode编码怎么实现? "
- C#_选择结构,Console的应用,数据类型转换
1:先看一个顺序结构编程,代码如下: using System; using System.Collections.Generic; using System.Linq; using System.T ...
- Leetcode题目226.翻转二叉树(简单)
题目描述: 翻转一颗二叉树 示例: 输入: 4 / \ 2 7 / \ / \ 1 3 6 9 输出: 4 / \ 7 2 / \ / \ 9 6 3 1 思路分析: 1)递归,不断交换左右子树,直到 ...