Spring's @RequestBody providing empty string on POST

前端 未结 4 2173
自闭症患者
自闭症患者 2020-12-19 03:15

I have an application with Spring 3.0.5.RELEASE trying to get the full content of a post using @RequestBody. The method is called, but the string passed is always empty. I h

4条回答
  •  生来不讨喜
    2020-12-19 03:55

    Another reason that your XML may not be getting marshalled into your JAXB object is related to the namespaces in the XML.

    Versions of java after 1.8.101 are more strict about parsing namespaced XML. See JAXB doesn't unmarshall after updating java from 1.8.0_77 to 1.8.0_121

    In my case I was seeing a request body with all nulls and no exception being thrown to indicate that the XML parsing had failed.

提交回复
热议问题