Spring boot 静态资源设置 二

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

--

发布了61 篇原创文章 · 获赞 1 · 访问量 621

猜你喜欢

转载自blog.csdn.net/u012842247/article/details/103958206