这是2.5下的一段代码@Controller
@RequestMapping("/user/role_*")
public class Role {    @RequestMapping(value="role_list")
    public void list(ModelMap model) {
        // something
    }
在2.5下可以使用 /user/role_list.do 访问到但是在3.0下出现了问题,貌似它内在的实现已经改变了。通过打印info级别信息,发现如下
INFO : Mapped URL path [/user/role_*/role_list.do] onto handler []
INFO : Mapped URL path [/user/role_*] onto handler []
INFO : Mapped URL path [/user/role_*.*] onto handler []
INFO : Mapped URL path [/user/role_*/] onto handler []不知有何解释??官方上不是明确提出spring3完全兼容2.5吗?

解决方案 »

  1.   

    从log可以看出,
    INFO : Mapped URL path [/user/role_*/role_list.do] onto handler [] 
    经过查阅官方文档,也可以知道,这里在class级别指定映射的目录结构,在方法级指定具体的文件名
      

  2.   

    楼主用的是SpringSide3.0吧?官方的3.0还没有正式版哦。
    SpringSide真正用的人不多。2.5官方版是这样的:
    @Controller
    @RequestMapping("/user/role.do")
    public class Role {    @RequestMapping(params="method=list")
        public void list(ModelMap model) {
            // something
        }官方的3.0以后好像可以这样:
    @Controller
    public class Role {    @RequestMapping(value="role_${id}")
        public void list(@PathVariable Integer id) {
            // something
        }
    }