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
--