随笔 - 137  文章 - 1  评论 - 3  阅读 - 14万 

   1  idea 新建项目

               

     2  选择springboot 版本以及相关配置  创建好项目

               

   

    3    设置项目配置

              

   4     初始化的项目结构如下

         

 

 

 

 

  5 新建IndexController 

     

    

复制代码
package com.example.demo.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class IndexController {

    @RequestMapping("/")
    public String index(){
        return " This is index pages ";
    }

    @RequestMapping("/hello")
    public String hello(){
        return " hello this is hello pages";
    }
}
复制代码

 

 

 

    6 idea配置tomcat 启动    

       配置服务启动的端口号

       

 

       

         

       

       

 

    7 启动tomcat 测试看看效果

 

 

 

 

 

          

posted on   ヽ坚强的蘑菇  阅读(30)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· 百万级群聊的设计实践
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
· 永远不要相信用户的输入:从 SQL 注入攻防看输入验证的重要性
历史上的今天:
2019-09-04 centos7.2 64位安装php7.2.12
点击右上角即可分享
微信分享提示