2011-01-20 123 views
0

我从ajax调用弹簧控制器,如/test/new.ui。如何在控制器方法中执行RequestMapping。如何做基于注释的RequestMapping

在此先感谢。

问候, 拉朱

+3

您阅读文档,你试试看,你回来这里,如果你不能让它工作,我们会很乐意提供帮助。 – skaffman 2011-01-20 08:41:19

回答

1
@Controller 
@RequestMapping("/test/") //This is optional to separate the /test/ part from the new.ui if you want to do other urls under the /test/ 
public class SomeController { 

    @RequestMapping("new.ui") //You can also do the entire url fragment here "/test/new.ui" 
    public Object handleNewMethod(/* ModelAttributes, Errors, RequestParams here */) { 
     // Code here 
    } 
}