Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring mvc SpringMVC-如何在请求映射中传递HashMap_Spring Mvc - Fatal编程技术网

Spring mvc SpringMVC-如何在请求映射中传递HashMap

Spring mvc SpringMVC-如何在请求映射中传递HashMap,spring-mvc,Spring Mvc,我正在使用SpringMVC和RESTFullWebService 来自我的客户机程序的代码片段 RestTemplate restTemplate = new RestTemplate(); String startProcessURL = "http://"+hostAddress+":"+portNumber+"/jBPMSpring/process/startProcess/"+processId 当我使用RequestMapping.GET方法时,上面的代码运行良好 在我的客户端程

我正在使用SpringMVC和RESTFullWebService

来自我的客户机程序的代码片段

RestTemplate restTemplate = new RestTemplate();

String startProcessURL = "http://"+hostAddress+":"+portNumber+"/jBPMSpring/process/startProcess/"+processId
当我使用RequestMapping.GET方法时,上面的代码运行良好

在我的客户端程序中,我需要在请求映射(POST)中传递HashMap


有什么变化,我需要通过HashMap。

有两个选项,postForLocation或

初始化后,您可以将hashmap包装到一个类中:

String result = rest.postForObject("http://whatever.com/whenever/", yourClass, String.class,);