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,好了

最新文章

  1. git init和git init -bare区别
  2. ubuntu 12.04下安装openldap,slapd.conf找不到的解决方法
  3. 原生js封装Ajax
  4. 总结Android中遇见的OOM
  5. Java源码分析系列
  6. 【转载】.NET模拟POST登录并保持登录状态
  7. [css]通过transform缩放邮件客户端h5页面
  8. 一个Brushes笔画应用ios源码完整版
  9. 实例详细说明linux下去除重复行命令uniq
  10. poj3321
  11. jQuery源代码 解析一 工具方法
  12. PHP - 抓取电视剧资源
  13. nginx配置文件【转载】
  14. js中常见的一些兼容性问题
  15. 中国 A 股纳入 MSCI
  16. yarn application ID 增长达到10000后
  17. Redis 简介(官方翻译)
  18. Gradle设置代理
  19. LinCode落单的数
  20. linux fg&amp;bg

热门文章

  1. 阿里妈妈的iconfont的引用问题
  2. java动态拼接sql语句并且执行时给sql语句的参数赋值
  3. redis主从同步,总是显示master_link_status:down的解决方法
  4. win2012 挂载硬盘即增加新硬盘方法
  5. luogu P3369 【模板】普通平衡树
  6. PHP0012:PHP操作文件目录
  7. C++\CLI使用.net委托,*Callback注意&quot;this&quot;
  8. 数据库-&gt;神奇的concat_ws函数
  9. Function and Function
  10. IO流学习之综合运用(文件复制)