`
lsj626472785
  • 浏览: 15606 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

spring-boot之helloWorld

阅读更多

需要添加一个类,然后写一个方法,注释使用RestController

@RestController

public class HelloWorld {

@RequestMapping("/")

public String sayHelloWorld(){

return "hello world!";

}

}

之后通过springApplicationMain中的类run启动即可

之后浏览器访问:http://127.0.0.1:8081/就可以看到hello world了

解释RestController注解的作用是返回json格式的数据

 

 

分享到:
评论

相关推荐

    spring-boot-01-helloworld.zip

    Spring Boot学习笔记-------(二)spring boot入门,配套例子代码,博客地址:https://blog.csdn.net/huaya1127/article/details/104130300

    spring-boot-helloworld

    这个项目是一个基础的spring-boot整合项目,麻雀虽小,五脏俱全,先提供给需要的人。

    spring-boot2.0全新教程实例20例.zip

    - [spring-boot-helloWorld](https://github.com/ityouknow/spring-boot-examples/tree/master/spring-boot-helloWorld):Spring Boot 的 hello World 版本 - [spring-boot-web]...

    Android代码-spring-boot-examples

    spring-boot-hello:Spring Boot 2.0 Hello World 示例 spring-boot-banner:Spring Boot 定制 Banner 示例 spring-boot-docker:使用 Docker 部署 Spring Boot 示例 dockercompose-springboot-mysql-nginx :Docker...

    spring-boot-helloworld.zip

    博客文章示例代码: spring boot 自学笔记(一) hello word

    Spring boot 示例 官方 Demo

    spring-boot-helloWorld:spring-boot的helloWorld版本 spring-boot-mybaits-annotation:注解版本 spring-boot-mybaits-xml:xml配置版本 spring-boot-mybatis-mulidatasource:springboot+mybatis多数据源最简解决...

    spring-boot示例项目

    helloworld|[spring mvc,Spring Boot项目创建,单元测试](https://github.com/smltq/spring-boot-demo/blob/master/helloworld/HELP.md) web|[ssh项目,spring mvc,过滤器,拦截器,监视器,thymeleaf,lombok,jquery,...

    spring-boot-hello-world:Spring Boot 应用程序示例

    spring-boot-hello-world Spring Boot 应用程序示例

    spring-boot很多实例

    server','springboot-elasticsearch','springboot-freemarker','springboot-helloworld','springboot-mybatis','springboot-mybatis-annotationspringboot-mybatis-annotation','springboot-mybatis-mutil-...

    【42】使用dubbo、spring-boot等技术实现互联网后台服务项目架构视频教程 .txt

    【42】使用dubbo、spring-boot等技术实现互联网后台服务项目架构视频教程 .txt

    spring-boot的helloWorld

    springboot的入门小程序,idea下的,亲测可用。请仔细阅读注释

    Spring Boot Examples

    spring-boot-helloWorld:spring-boot的helloWorld版本 spring-boot-mybaits-annotation:注解版本 spring-boot-mybaits-xml:xml配置版本 spring-boot-mybatis-mulidatasource:springboot+mybatis多数据源最简...

    about learning Spring Boot. Spring Boot 教程、技术栈示例代码,快速简单上手教程.zip

    Spring Boot 学习示例 Spring Boot 2.0 Mysql 5.6 ...spring-boot-helloworld:Spring Boot 3.0 Hello World Test 单元测试示例 spring-boot-scheduler:Spring Boot 3.0 定时任务 scheduler 使用示例 .....

    helloworld-spring-boot-starter.zip

    helloworld-spring-boot-starter 自定义starter代码及测试函数...

    spring boot 42讲配套源码.zip

    第 1-4 课:写一个 Hello World 来感受 Spring Boot/hello 第 2-1 课: Spring Boot 对基础 Web 开发支持/spring-boot-web 第 2-10 课: 使用 Spring Boot WebSocket 创建聊天室/spring-boot-websocket 第 2-2 课...

    spring-boot2-example:spring-boot2-例子

    01-spring-boot-helloWorld //调度器 02-spring-boot-banner//springboot标识广告 03-spring-boot-scheduler//任务调度器 04-spring-boot-mybatis-xml//mybaist-xml方式 05-spring-boot-logback//默认logback日志...

    spring boot - hello world

    博客示例代码,Spring boot 自学笔记(一) hello world 代码

    springboot 基础简易实例, maven项目

    <groupId>org.springframework.boot <artifactId>spring-boot-starter-parent <version>2.1.4.RELEASE <relativePath/> <!-- lookup parent from repository --> <groupId>com.example</groupId> ...

    spring-boot-examples

    :spring-boot的helloWorld版本 :注解版本 :xml配置版本 spring-boot-mybatis-mulidatasource:springboot+mybatis多数据源最简解决方案 spring-boot-mybatis-annotation-mulidatasource:springboot+mybatis...

    spring-boot-hello-world

    Spring Boot应用程序样本 该示例Spring Boot应用程序是为博客文章编写的,该博客文章描述了如何使用IntelliJ创建Spring Boot应用程序。

Global site tag (gtag.js) - Google Analytics