Spring Boot Development Series A development environment for some 99

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.