zoukankan      html  css  js  c++  java
  • springboot-helloworld-idea

    1、file-new-project-Spring Initializr-next:输入项目信息-next:web-next-finish

    2、创建controller包

    3、创建StudyController类

    @RestController
    @RequestMapping
    public class StudyController {
    
        @RequestMapping(value = "/test", method = RequestMethod.GET)
        public String test(@RequestParam(value = "userName") String userName){
            return userName;
        }
    }
    

    4、访问http://localhost:8080/test?userName=a

    备注:如果pom文件有问题

    <parent>
    	<groupId>org.springframework.boot</groupId>
    	<artifactId>spring-boot-starter-parent</artifactId>
    	<version>2.0.5.RELEASE</version>
    	<relativePath/> <!-- lookup parent from repository -->
    </parent>
    
    修改为
    
    <parent>
    	<groupId>org.springframework.boot</groupId>
    	<artifactId>spring-boot-starter-parent</artifactId>
    	<version>2.0.2.RELEASE</version>
    	<relativePath/> <!-- lookup parent from repository -->
    </parent>
    

      

      

  • 相关阅读:
    前端开发流程
    前端组件化开发方向
    模板引擎
    css模块化
    js组件化、模块化开发
    前端开发流程
    模块化开发
    XSS攻击
    react组件化开发发布到npm
    js过滤字符串中的html标签
  • 原文地址:https://www.cnblogs.com/lichangyunnianxue/p/9766167.html
Copyright © 2011-2022 走看看