java - learning Spring's @RequestBody and @RequestParam -
i'm editing web project uses spring , need adding of spring's annotations. 2 of ones i'm adding @requestbody , @requestparam. i've been poking around little , found this, still don't understand how use these annotations. provide example?
controller example:
@controller class foocontroller { @requestmapping("...") void bar(@requestbody string body, @requestparam("baz") baz) { //method body } }
@requestbody: variable body contain body of http request
@requestparam: variable baz hold value of request parameter baz
Comments
Post a Comment