SpringBoot快速入门
SpringBoot快速入门
SpringBoot快速入门参考网站创建Maven项目pom.xml配置信息如下代码语言:javascript代码运行次数:0运行复制<project xmlns=".0.0" xmlns:xsi=";
xsi:schemaLocation=".0.0 .xsd">
<modelVersion
SpringBoot快速入门
参考网站
创建Maven项目
pom.xml
配置信息如下
代码语言:javascript代码运行次数:0运行复制<project xmlns=".0.0" xmlns:xsi=";
xsi:schemaLocation=".0.0 .xsd">
<modelVersion>4.0.0</modelVersion>
<groupId></groupId>
<artifactId>SpringBootStudy</artifactId>
<version>1.0-SAPSHOT</version>
<name>Archetype - SpringBootStudy</name>
<url>;/url>
<!-- springboot工程需要继承的父工程-->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.4</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<dependencies>
<!-- web开发的起步依赖-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
</project>
创建文件结构
HelloController
代码语言:javascript代码运行次数:0运行复制package com.;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HelloController {
@RequestMapping("/hello")
public String hello(){
return "hello Spring Boot !";
}
}
HelloApplication
代码语言:javascript代码运行次数:0运行复制package com.study;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/*
* 引导类:SpringBoot项目的入口
* */
@SpringBootApplication
public class HelloApplication {
public static void main(String[] args) {
SpringApplication.run(, args);
}
}
运行结果
访问网址
#感谢您对电脑配置推荐网 - 最新i3 i5 i7组装电脑配置单推荐报价格的认可,转载请说明来源于"电脑配置推荐网 - 最新i3 i5 i7组装电脑配置单推荐报价格
上传时间: 2025-07-19 22:30:05
推荐阅读
留言与评论(共有 12 条评论) |
本站网友 必普 | 0秒前 发表 |
如有侵权请联系 cloudcommunity@tencent 删除前往查看继承配置入门网站boot | |
本站网友 喜马拉雅中心 | 29分钟前 发表 |
原始发表:2022-12-21 | |
本站网友 土牛膝 | 13分钟前 发表 |
args); } }运行结果访问网址本文参与 腾讯云自媒体同步曝光计划 | |
本站网友 驼峰鼻修复价格 | 3分钟前 发表 |
args); } }运行结果访问网址本文参与 腾讯云自媒体同步曝光计划 | |
本站网友 自然堂护肤品 | 30分钟前 发表 |
schemaLocation=".0.0 .xsd"> <modelVersion>4.0.0</modelVersion> <groupId></groupId> <artifactId>SpringBootStudy</artifactId> <version>1.0-SAPSHOT</version> <name>Archetype - SpringBootStudy</name> <url>;/url> <!-- springboot工程需要继承的父工程--> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.5.4</version> <relativePath/> <!-- lookup parent from repository --> </parent> <dependencies> <!-- web开发的起步依赖--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> </dependencies> </project>创建文件结构HelloController代码语言:javascript代码运行次数:0运行复制package com.; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class HelloController { @RequestMapping("/hello") public String hello(){ return "hello Spring Boot !"; } }HelloApplication代码语言:javascript代码运行次数:0运行复制package com.study; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; /* * 引导类:SpringBoot项目的入口 * */ @SpringBootApplication public class HelloApplication { public static void main(String[] args) { SpringApplication.run( | |
本站网友 李珏 | 25分钟前 发表 |
schemaLocation=".0.0 .xsd"> <modelVersion>4.0.0</modelVersion> <groupId></groupId> <artifactId>SpringBootStudy</artifactId> <version>1.0-SAPSHOT</version> <name>Archetype - SpringBootStudy</name> <url>;/url> <!-- springboot工程需要继承的父工程--> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.5.4</version> <relativePath/> <!-- lookup parent from repository --> </parent> <dependencies> <!-- web开发的起步依赖--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> </dependencies> </project>创建文件结构HelloController代码语言:javascript代码运行次数:0运行复制package com.; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class HelloController { @RequestMapping("/hello") public String hello(){ return "hello Spring Boot !"; } }HelloApplication代码语言:javascript代码运行次数:0运行复制package com.study; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; /* * 引导类:SpringBoot项目的入口 * */ @SpringBootApplication public class HelloApplication { public static void main(String[] args) { SpringApplication.run( | |
本站网友 efsf | 28分钟前 发表 |
xsi="; xsi | |
本站网友 北京307 | 24分钟前 发表 |
分享自作者个人站点/博客 | |
本站网友 92号汽油 | 24分钟前 发表 |
xsi="; xsi | |
本站网友 新辣道鱼火锅 | 6分钟前 发表 |
如有侵权请联系 cloudcommunity@tencent 删除前往查看继承配置入门网站boot | |
本站网友 家装壁柜 | 5分钟前 发表 |
SpringBoot快速入门 SpringBoot快速入门参考网站创建Maven项目pom.xml配置信息如下代码语言:javascript代码运行次数:0运行复制<project xmlns=".0.0" xmlns |