Can somebody tell me how to configure @RestController?
I do this :
@RestController
@EnableAutoConfiguration
public class Application {
@RequestMapping("/test.htm")
@ResponseBody
String home() {
return "Hello Worlds!";
}
public static void main(String[] args) throws Exception {
SpringApplication.run(Application.class, args);
}
}
@Controller
public class MusicControler {
class Test{
String name;
int age;
}
@RequestMapping(value = "/MyController")
public Test MyController() {
Test test = new Test();
test.name = "zl.shi";
test.age = 16;
return test;
}
}
When I request /test.htm
, it is ok but I get response 404 for /testController.htm
. Can someone help me about it?