0
There was an unexpected error (type=Not Found, status=404).
在瀏覽器中呈現,同時創下了http://localhost:8080SpringBoot Web應用程序:JSP頁面拋出404錯誤
MySpringBoot起始頁上述錯誤:
@SpringBootApplication
public class AppStart {
public static void main(String[] args) {
SpringApplication.run (AppStart.class,args);
}
}
我的控制器:
@Controller
public class MyController {
@RequestMapping("/hello/{name}")
public @ResponseBody ModelAndView hello (@PathVariable String name){
System.out.println("AppStartController:hello ");
ModelMap model = new ModelMap();
model.addAttribute("name", name);
return new ModelAndView("index");
}
}
我的index.jsp有「Hello World」文本。