我有一个服务于 ajax 调用的 serveresource 方法。我正在尝试使用 MockResourceRequest 和 MockResourceResponse 为这个 serverresource 方法编写一个单元测试。如果有人对此有一个例子,我真的需要一些帮助。提前致谢..
请参阅下面的控制器来处理 ajax 调用,这是 JSR 286 中的一种服务资源方法
[编辑]
@Controller
@RequestMapping("VIEW")
public class Controller {
@ResourceMapping(value = "")
public String addMethod(ResourceRequest request, ResourceResponse response){
/* My logic to send the request attributes to Web Service and then push
the results to the JSP page*/
}
}