Starting today to write this spring Boot development series, I was the second week to learn Java, the company called Springboot Java Development to the ability to fill the blanks, I am net to Java, want to see how strong the fill in the blanks. Don't say much nonsense, strong not strong, the code of the piece to try it.
People who have written net for the first time to see the directory of Java this project file, there is no sense of wanting to die, a into Java deep like the Sea, N expansion is not find code, I go, in fact, here can be set to the back of this xx.xx.xx package mode display, the authorities here.
It means to hide the empty intermediate transition package, which is then turned into a comfortable feeling behind the back.
2. Code formatting: ctr+alt+l
3. Auto-Restore project dependent, I am a novice, master Aeolosma.
[Email protected] @RequestBody @RequestParam
@PathVariable and @RequestParam can use the pass-through parameters, for example:
@RequestMapping ("/finduserbyhobby/{userid}")
Public Userdetail Finduserbyhobby (httpservletrequest request, @PathVariable (required = false) long userid,@ Requestparam (required = false) String hobby) {
System.out.println ("userid:" +userid);
SYSTEM.OUT.PRINTLN ("Model:" +model.tostring ());
System.out.println ("hobby:" +hobby);
return Userserivce.findbyhobby (hobby);
}
@RequestBody and @RequestParam can be used together
@RequestMapping ("/finduserbyhobby")
Public Userdetail Finduserbyhobby (httpservletrequest request, @RequestParam (required = false) String hobby,@ Requestbody (required = false) UserInfo model) {
System.out.println ("userid:" +userid);
SYSTEM.OUT.PRINTLN ("Model:" +model.tostring ());
System.out.println ("hobby:" +hobby);
return Userserivce.findbyhobby (hobby);
}
But
Spring Boot Development Series A development environment for some 99