Spring boot set up two static resources

1, above using the content of 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 represents the controller comment

It returns a string that represents @ResponseBody json

@RequestMapping represents the path mapped plea.

----

Static resource file default path

The default file is in the Resources

resources/static

resources/META-INF/static

resources/public

--

Published 61 original articles · won praise 1 · views 621

Guess you like

Origin blog.csdn.net/u012842247/article/details/103958206