我有一种情况,我需要以下内容RequestMapping:
@RequestMapping(value={"/{section}"})
...method implementation here...
@RequestMapping(value={"/support"})
...method implementation here...
有明显的冲突。我希望 Spring 会自动解决这个问题并映射/support到第二种方法,而其他一切都映射到第一种方法,但它会映射/support到第一种方法。
我如何告诉 Spring 允许在同一个地方显式地用 aRequestMapping覆盖 a ?RequestMappingPathVariable
编辑2:/support如果映射在映射之前,它似乎会起作用/{section}。不幸的是,我们有几十个控制器,其中包含许多带有RequestMapping. 如何确保具有/{section}映射的控制器最后初始化?或者预拦截器是要走的路吗?
编辑1:这是简化的,我知道RequestMapping单独拥有这两个没有多大意义)