Consider the following example:
@Controller
@RequestMapping({"/home"})
public class Home {
@RequestMapping(value = { "", "/" })
public String index() {
return "home";
}
@RequestMapping(value = { "-of-{id}" })
public String of(@PathVariable("id") String id) {
System.out.println(id);
return "home";
}
}
index() is mapped to '/home' and '/home/' perfectly; but of(id) is mapped to '/home/-of-{id}' when I want it to be mapped to '/home-of-{id}'.
Spring add a slash between '/home' and '-of-{id}' automatically, but I want to eliminate it, any suggestion?