如何转发到具有相同URI的另一个控制器方法?

时间:2015-04-19 17:05:45

标签: java spring-mvc forward

我的控制器中有以下两种方法具有相同的URI:

         @RequestMapping(value = "/member/createCompany/addParams", method =  RequestMethod.POST)
         public String setCompanyParams(
             @ModelAttribute @Valid CampaignBeanDto campaignBeanDto, BindingResult bindingResult,
             @RequestParam(value = "g-recaptcha-response") String  recapchaResponse,
             HttpSession session, Principal principal, Model model) throws Exception {
                  return "forward:/member/createCompany/addParams";
         }

         @RequestMapping(value = "/member/createCompany/addParams", method = RequestMethod.GET)
         public String createCompanyAddParams(Principal principal, Model model, HttpSession session) {        
               return "member/createCompany/addParams";
         }

我从前端调用get POST方法,然后循环并再次调用POST方法。

如何重写前进以调用GET方法?

0 个答案:

没有答案