Skip to content

Spring mvc Controller方法里的参数如何自动封装的? #1

@aBreaking

Description

@aBreaking

我知道Controller里的方法 接收前台的json会自动封装到方法参数,那么

  1. 这个参数是怎么自动封装的?
  2. 可不可以自定义处理呢?比如有规范前后端交互的json都要嵌套在HEAD, BODY,但我只想Controller自动封装参数时,只要BODY里的json

'''json
{
HEAD:{
// 一些请求头信息,不需要关注
},
BODY:{
USER:{
// user的信息,只想要这里面的json,然后希望能被封装成对象到方法参数里
}
}
}
'''

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions