How to implement the mapping rules of controller that need to be combined with the request parameter method in URL

requirements:
http://localhost:80/order/service?method=getTradeInfo

http://localhost:80/order/service?method=createTrade
requires method to decide which method to map to which controller, and how should it be implemented?
now only knows that spring mvc will use / order/service and request method (get,post) to determine which controller method should process the request.

Mar.02,2021

http://localhost:8080/order/service/{method}
(@PathVariable String method)
methodservice

A method of

controller, and then parse the value of the input parameter method, taking different logical branches

@RequestMapping("/order/service")
public ModelAndView process(String method){
    // method
    
}

depends on whether the owner of the building is for the purpose of realizing the function or deliberating the research. To realize the function, you can do as the two people upstairs say. If you make a careful study, spring cannot directly map the parameters to the


1 of the control layer method.
2 can implement the springmvc mapper on its own, but this should not be a standard rest interface

.
Menu