Почему я не могу использовать TreeMap<String,String>
после @RequestParam?Это работает, когда я использую
Map<String,String>
Пример:
@RequestMapping(value = "customers/new", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<String> createAuthorizationRole(
@RequestParam TreeMap<String, String> hierarchy,
@RequestHeader(name = "userid") String userid,
@RequestHeader(name = "clientid") String clientid,
@RequestHeader(name = "authorization") String authToken) {
return new ResponseEntity<>("new Customer created", HttpStatus.OK);
}
Это ошибка, которую я вижу:
java.lang.IllegalStateException: argument type mismatch
HandlerMethod details:
Controller [com.demo.customer.odr.pc.branchAuthorization.BranchAuthorizationController]
Method [public org.springframework.http.ResponseEntity<java.lang.String> com.walmart.replenishment.odr.pc.branchAuthorization.BranchAuthorizationController.createAuthorizationRole(java.util.TreeMap<java.lang.String, java.lang.String>,java.lang.String,java.lang.String,java.lang.String)]
Resolved arguments:
[0] [type=java.util.LinkedHashMap] [value={country=US, division=1, department=17, category=9295, subcategory=21032, subclass=0, fineline=9379}]
[1] [type=java.lang.String] [value=office\r0sss]
[2] [type=java.lang.String] [value=05af7587-2209-49e3-9193-64828ad240b3]
[3] [type=java.lang.String] [value=dhfdrNGXU7j19DZb]