@RequestMappingに複数の値をマップすると(Multiple Spring @RequestMapping annotationsなど)、要求された値(URL)を取得できますか?@RequestMapping注釈を使用する際にリクエストされた値(URL)を取得する
@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;
}
を使用することができます。 (彼の言葉の "値"はちょっと混乱しています) – Ralph