Card input parameter with dash to model in Spring Controller

I have the following property that I need to map to the post parameter in Spring. Is there an attribute that I can use? It accepts the application / x -www-form-urlencoded for line-based file loads, multipart / form-data for binary payloads. Other properties are displayed perfectly, without underlining.

String deliveryAttemptId;

mapped to post

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;
0
source share
1 answer

Spring. . , .NET , Spring.

HttpServletRequest lowecase

 @RequestMapping(method = RequestMethod.POST, value = "/grade")
        @ResponseBody
        public void grade(HttpServletRequest request, HttpServletResponse response) throws Exception {  

            EventNotificationRequest notificationRequest = new LearningStudioEventNotificationRequest();
            notificationRequest.setDeliveryAttemptId(getCaseInsensitiveParameter(request, "DELIVERY-ATTEMPT-ID"));
0

Source: https://habr.com/ru/post/1726304/


All Articles