【发布时间】:2017-09-18 08:29:25
【问题描述】:
There was an unexpected error (type=Not Found, status=404).
点击http://localhost:8080时在我的浏览器中呈现上述错误
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”文本。
【问题讨论】:
标签: java maven jsp tomcat spring-boot