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

后端 未结 5 863
长情又很酷
长情又很酷 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:09

    A controller class is a Java class like any other. Although Spring does clever magic for you, using reflection to examine the annotations, your code can call methods just as normal Java code:

     public String updatePasswd()
     {
        User u = getUser();
        // manipulate u here
        return u;
     }
    

提交回复
热议问题