当我尝试使用我的Spring模板基础测试方法调用以下MultipartFile Spring REST URL时,我遇到了以下异常.我怎样才能做到这一点.谢谢.
Spring REST URL:
@RequestMapping(value = "/media/uploadMultipartFile/{token}/{title}/{trailId}/{wpId}", method = RequestMethod.POST)
public @ResponseBody MediaHttp uploadMultipartFile(@RequestParam MultipartFile file,
@PathVariable String token,
@PathVariable String title,
@PathVariable String trailId,
@PathVariable String wpId,
HttpServletResponse response)
测试方法:
try {
// Message Converters
List> messageConverters = new ArrayList>();
messageConverters.add(new FormHttpMessageConverter());
messageConverters.add(new SourceHttpMessageConverter
例外:
[ http://test.com:8080/DMW-skeleton-1.0/media/uploadMultipartFile/ {token}/{title}/{trailId}/{wpId}]中的变量值无效:预期为4; 得到0