org.springframework.web.bind.MissingServletRequestParameterException,tomcat无法获取日期

时间:2018-06-07 07:32:20

标签: java spring-boot wechat

当我将@RequestBody更改为@RequestParam时,会抛出此异常。

this is what hearers show

抛出title' not exit,但我在bean中定义了标题  it throws out "'title' not exit",but i have defined title in bean

@RequestMapping(value="post")
public void throwpost(@RequestParam(value="title") String title,@RequestParam(value="destination") String destination,
        @RequestParam(value="time") String time,@RequestParam(value="plan") String plan){
    System.out.println("dd");
    System.out.println(title);
    System.out.println(destination);
    //System.out.println(threshold);
    System.out.println(time);
    System.out.println(plan);
    //postservice.makepost(title,plan, destination,threshold, time);
}

1 个答案:

答案 0 :(得分:0)

我的朋友@RequestParam@RequestBody之间存在差异,您似乎想在@RequestBody中使用@RequestParam属性。 您可以搜索这些@RequestParam@RequestBody@PathVariable之间的差异,以便更好地了解这三者的用法。反而是搜索会帮助你。