@RequestMapping and @modelattribute Routines

Source: Internet
Author: User

New contact with a project, using a large number of annotations;

Note that the page's jump was not found when viewed through the request path, and then all the methods and annotations in the file were checked before finding the corresponding path.

1@ModelAttribute ("Totalfinal")2      Publictotalfinal get (String ID) {3         if(Stringutils.isnotblank (id)) {4Totalfinal totalfinal =Totalfinalservice.get (Integer.parseint (ID));5             returntotalfinal;6}Else{7             return Newtotalfinal ();8         }9     }Ten     
1@RequestMapping (value = {"", "list"})2      PublicString List (totalfinal totalfinal, httpservletrequest request, httpservletresponse response, model model) {3page<totalfinal> page = Totalfinalservice.find (NewPage<totalfinal>(Request, response), totalfinal); 4Model.addattribute ("page", page);5Model.addattribute ("Totalfinal", totalfinal);6         return"Modules/pams/wage/finalwage";7}

@ModelAttribute: The annotated method, after the request entered, priority execution (can be said to be the first execution), the detailed use of Baidu can be;

@RequestMapping: Callout Value value={"", "List"} indicates that the request path can be a list or not, such as Http://127.0.0.1:8080/instr/a/pams/totalfinal/list and H Ttp://127.0.0.1:8080/instr/a/pams/totalfinal can enter the secondary method;

When using CTRL+H queries in programming tools such as Eclipse, it is difficult to find a method that is @RequestMapping: Callout value value={"", "list"} Callout

@RequestMapping and @modelattribute Routines

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.