I am playing with spring MVC 3.1 and testing different features. I wanted to verify following statement taken from @RequestMapping#value doc
If you have a single
If you have a controller as given below, all requests other than /book/edit
will be directed to mydefault()
while /book/edit
will be sent to meet()
.
@Controller
@RequestMapping("/book")
public class BookController {
@RequestMapping
public @ResponseBody String mydefault() {
return "Hi Book!";
}
@RequestMapping("/edit")
public @ResponseBody String meet() {
return "Nice to meet you Book!";
}
}
In your sample you have two methods without explicit path mapping.