Such as the annotation WebServlet ("/User/AAA), WebServlet ("/User/BBB "), I want to achieve are the two paths to a program (because there are some common pretreatment, don't want to write it again in every web application), and then internally to deal with the difference between AAA and BBB, what practices can be implemented?
CodePudding user response:
Method are many, you can be the AAA, BBB on a parameter,
The rest style of fashion now in general use path parameter approach to
@ RequestMapping (value="{id}" https://bbs.csdn.net/User/
Public String aaaaaa (@ PathVariable String id) {
return null;
}