Java 如何进行基于注释的请求映射

Java 如何进行基于注释的请求映射,java,spring,spring-mvc,Java,Spring,Spring Mvc,我从ajax调用spring控制器,比如/test/new.ui。如何在控制器方法中进行请求映射 提前谢谢 问候,, Raju您阅读了文档,尝试了一下,如果无法使其正常工作,请回到这里,我们很乐意提供帮助。Keith Donald写了一篇关于如何使用SpringMVC和ajax的好博客。 @Controller @RequestMapping("/test/") //This is optional to separate the /test/ part from the new.ui if y

我从ajax调用spring控制器,比如
/test/new.ui
。如何在控制器方法中进行请求映射

提前谢谢

问候,,
Raju

您阅读了文档,尝试了一下,如果无法使其正常工作,请回到这里,我们很乐意提供帮助。Keith Donald写了一篇关于如何使用SpringMVC和ajax的好博客。
@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
    }
}