1、 上文中使用springMvc 的内容
package com.fandong.it.weapon.Controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
public class HelloController {
@ResponseBody
@RequestMapping("/hello")
public String hello(){
return "hello,spring boot";
}
}
@Controller 表示是控制器注解
@ResponseBody 表示返回一个json字符串
@RequestMapping 表示求情映射的路径。
----
静态资源文件默认路径
默认是在Resources 文件下
resources/static
resources/META-INF/static
resources/public
--