Quando si associano più valori a @RequestMapping (come Multiple Spring @RequestMapping annotations), è possibile ottenere il valore richiesto (URL)?Ottieni il valore richiesto (URL) quando si utilizzano le annotazioni @RequestMapping
Ti piace questa:
@RequestMapping(value={"/center", "/left"}, method=RequestMethod.GET)
public String getCenter(Model model) throws Exception {
String requestedValue = getRequestedValue(); // I want this.
// I want to do something like this with requested value.
String result;
if (requestedValue.equals("center")
result = "center";
else if (requestedValue.equals("left")
result = "left";
return result;
}
E cuciture che Sangdol significa URL diversi e non con quelli HTTP. (Quindi il suo termine "valori" è un po 'confuso) – Ralph