How to call one controller to another controller URL in Spring MVC?

后端 未结 5 867
长情又很酷
长情又很酷 2021-01-03 00:34

Hi I am new to Spring MVC ,I want to call method from one controller to another controller ,how can I do that .please check my code below

@Controller

    @R         


        
5条回答
  •  悲哀的现实
    2021-01-03 01:01

    You should place method getUser in a service (example UserService class) .

    In the getUser controller, you call method getUser in the Service to get the User

    Similarly, in the updatePswd controller, you call method getUser in the Service ,too

提交回复
热议问题