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 ...
随机推荐
- React给state赋值的两种写法
如果你看过React的官方文档,就会对怎么给局部state赋值有一定的了解.如下代码: class Test extends React.Component { constructor(props) ...
- Java8-Stream-No.06
import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; import java.util.s ...
- 包过滤防火墙iptables(网络层)
安装: yum -y install iptables-services 启动:systemctl start iptables.service 四表五链 过滤:filter - input forw ...
- CentOS 7 yum update 升级提示:PackageKit 锁定解决方案
CentOS 7 系列新安装后都会进行yum update操作,但每次都会遇到PackageKit 锁定问题,提示如下: /var/run/yum.pid 已被锁定,PID 为 2694 的另一个程序 ...
- python 学习资料 常用
https://www.cnblogs.com/vamei/archive/2012/09/13/2682778.html 利用python 进行数据分析第二版 https://www.jianshu ...
- OSError: cannot open resource(pillow错误处理)
https://www.jianshu.com/p/c64ae3e9b196 pillow使用备忘之OSError: cannot open resource错误处理 在使用pillow过程中,Pyt ...
- MySQL 5.7半同步复制技术
一.复制架构衍生史 在谈这个特性之前,我们先来看看MySQL的复制架构衍生史. 在2000年,MySQL 3.23.15版本引入了Replication.Replication作为一种准实时同步方式, ...
- js中的DOM对象和jQuery对象的比较
1. 二者的不同之处: 通过jQuery获取的元素是一个数组, 数组中包含着原生JS中的DOM对象. 例如, 针对下面的一个div结构: <div id="Box">& ...
- Python之从继承到C3算法
在Python2.X和Python3.X有很多不同的地方,其中一个区别就是和继承有关. 在Python3.X中,一个类如果没有指明其继承哪个类的时候,其默认就是继承object类. 而在Python2 ...
- Python3 Address already in use 解决方法
1.查看使用端口号netstat -ntlp 2.根据端口号找到pid 3.杀死程序 kill -9 pid 4.重新启动程序 简单粗暴 我使用python3时编写Socket,linux系统下使用c ...