I have the following property that I need mapped to a post parameter in Spring. Is there an attribute I can use? It accepts application/x-www-form-urlencoded for string-based payloads, multipart/form-data for binary payloads. Other properties are mapping fine without underscores.
String deliveryAttemptId;
mapped to the post parameter
DELIVERY-ATTEMPT-ID
Controller
@Controller
@RequestMapping("/notifications")
public class NotificationController {
@RequestMapping(method = RequestMethod.POST)
@ResponseBody
public void grade(EventNotificationRequest request, HttpServletResponse response) throws Exception {
}
Model
public class EventNotificationRequest {
String deliveryAttemptId;
I just made a work around for this Spring limitation. This also fixes case sensitivity issues with parameters. Sorry I am used to .NET and how easy binding is so it's frustrating to run into these Spring issues.
HttpServletRequest parameter lowecase