I am using Spring mapping. And have the following mapping code. The problem is there are like 20 possible misspelling for these and others that need to be accounted for. Rather than add a RequestMapping for each url which would be like 30 or 40, is there a way to simply redirect these. I know the way I am doing is not clean and would appreciate advice on how to keep my request mappings to a minium. Thanks.
@RequestMapping("/protect")
public String protect(Model model) {
QuickResponse qr = createQR();
model.addAttribute("qr", qr);
return "qr_general";
}
I am unsure as to what can be misspelled, but I am thinking you are referring to the path that is being mapped to.
The
@RequestMapping
annotation's defaultvalue
member takesString[]
, so you should be able to put all of your mappings in one location: