Announcement Announcement Module
Collapse
No announcement yet.
mvc interceptors requestbody always empty Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • mvc interceptors requestbody always empty

    Hi experts,

    To support multi language, I use mvc:interceptors

    Code:
    <mvc:interceptors>  
            <bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
                  <property name="paramName" value="lang"></property>
            </bean>
    </mvc:interceptors>
    It works as well as my expectation.

    To post data from UI to server by AJAX, i have this controller:
    Code:
    @RequestMapping(value = "/something", method = RequestMethod.POST)
    public void saveData(@RequestBody String body) throws IOException {
      //do something here
    }
    My controller works, but the body is always empty

    I don't know why my body is always empty, if I remove the i18n config, my controller work well.

    Please tell me why and how to fix this bug.

    Thank you.
Working...
X