2016-07-12 45 views

回答

1

您可以定義您的像這樣的控制器:

@RequestMapping(value="get", method = RequestMethod.GET) 
public String get(ModelMap model) { 

    ... ... 
    do something 
    ... ... 

    return "getpage"; 
} 

@RequestMapping(value="post", method = RequestMethod.POST) 
public String post(ModelMap model) { 

    ... ... 
    do something 
    ... ... 

    return "redirect:/get"; 
} 
相關問題