我正在玩spring MVC 3.1并测试不同的功能.我想验证来自@ RequestMapping#value doc的以下声明
If you have a single default method (without explicit path mapping), then all requests without a more specific mapped method found will be dispatched to it. If you have multiple such default methods, then the method name will be taken into account for choosing between them
Run Code Online (Sandbox Code Playgroud)
所以我用多个默认处理程序方法创建了以下控制器
@Controller
@RequestMapping("/book")
public class BookController {
@RequestMapping
public @ResponseBody String greet() {
return "Hi Book!";
}
@RequestMapping
public @ResponseBody String meet() {
return "Nice to meet …
Run Code Online (Sandbox Code Playgroud)