Spring MVC通配符

时间:2012-11-15 02:13:21

标签: spring-mvc

  

可能重复:
  Spring 3 RequestMapping: Get path value

有谁知道如何映射某个URL下的所有内容,然后将该映射值捕获到请求变量中?

@RequestMapping("/content/{path:.*}") // matches only one level
@RequestMapping("/content/**")        // matches everything, can't catch
                                      // the actual value matched by the two stars
@RequestMapping("/content/{path:**}") // does not compute

我需要映射的是:

/content/a.gif
/content/a/b.gif
/content/a/b/c.gif
/content/a/b/c/d.gif

这真是令人沮丧,因为它是如此常见的情况。

0 个答案:

没有答案