相关疑难解决方法(0)

Spring MVC 3:发现了模糊映射

我正在玩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)

spring-mvc spring-3

15
推荐指数
2
解决办法
5万
查看次数

标签 统计

spring-3 ×1

spring-mvc ×1