创建spring boot 项目
2024-10-08 09:01:26
1、新建Spring Starter Project(需要连接外网)
2、选择web
3、点击完成,生成maven项目
pom文件默认有一些依赖,但是有一个地方报错,<parent>节点报错,去本地仓库查询这个依赖时,显示的是.lastUpdated,于是手工拷贝了下其他项目仓库的这个依赖,就好了
4、项目目录如下所示
5、添加controller类
package com.htkeystone.dcg.controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; @Controller
public class DemoController {
@RequestMapping("/hello")
String home() {
return "hello wss";
}
}
6、右键DemoApplication.java---Run As--Java Application,报错
把@Controller改为@RestController,好了
最新文章
- git init和git init -bare区别
- ubuntu 12.04下安装openldap,slapd.conf找不到的解决方法
- 原生js封装Ajax
- 总结Android中遇见的OOM
- Java源码分析系列
- 【转载】.NET模拟POST登录并保持登录状态
- [css]通过transform缩放邮件客户端h5页面
- 一个Brushes笔画应用ios源码完整版
- 实例详细说明linux下去除重复行命令uniq
- poj3321
- jQuery源代码 解析一 工具方法
- PHP - 抓取电视剧资源
- nginx配置文件【转载】
- js中常见的一些兼容性问题
- 中国 A 股纳入 MSCI
- yarn application ID 增长达到10000后
- Redis 简介(官方翻译)
- Gradle设置代理
- LinCode落单的数
- linux fg&;bg
热门文章
- 阿里妈妈的iconfont的引用问题
- java动态拼接sql语句并且执行时给sql语句的参数赋值
- redis主从同步,总是显示master_link_status:down的解决方法
- win2012 挂载硬盘即增加新硬盘方法
- luogu P3369 【模板】普通平衡树
- PHP0012:PHP操作文件目录
- C++\CLI使用.net委托,*Callback注意";this";
- 数据库->;神奇的concat_ws函数
- Function and Function
- IO流学习之综合运用(文件复制)