, HTTP GET, POST. , HTTP-.
-, URL , value RequestMapping.
-, RESTful PathVariable :
@RequestMapping(value="/account/{accountid}/details", method = RequestMethod.GET)
public @ResponseBody String getAccountDetails(@PathVariable(value="accountid") String accountid){
return somefunct.getAccountDetails(accountid);
}
URL-, URL- , " " :
// when get account summary is clicked it will call this method
@RequestMapping(value="/account/{accountid}/summary", method=RequestMethod.GET)
public @ResponseBody String getAccountSummary(@PathVariable(value="accountid") String accountid){
return somefunct.getAccountSummary(accountid);
}
, , . , , GET, , , . HTTP-, , - HTTP POST. HTTP PUT .
PUT POST , PUT , , , . , POST.
, URL-. , . , POST. , PathVariable, URL, RequestBody, , Java:
@RequestMapping(value="/account/{accountid}", method=RequestMethod.POST)
public String submitForm(@PathVariable String accountid, @RequestBody Account account){
return "myform";
}
Spring MVC Spring Spring MVC.