How to retrieve FORM/POST Parameters in Spring Controller?

倾然丶 夕夏残阳落幕 提交于 2019-11-30 14:52:19
Óscar Ibáñez Fernández

You just need to inject WebRequest as a parameter into your controller POST method, and then ask for getParameter(), with a given parameter from the Mailchimp webhook.

e.g:

@RequestMapping(path="/MyUrl", method=RequestMethod.POST)
public ModelAndView process(WebRequest request){
    System.out.println(request.getParameter("type"));
    System.out.println(request.getParameter("data[merges][EMAIL]"));
    return new ModelAndView([YOURVIEWHERE]);
}

That's all...

Regards.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!