URL不区分大小写
spring mvc对于请求URL默认是区分大小写的。
如定义一个controller,其请求path为/welcome。
@Controller
public class HomeController {
@RequestMapping(value = "/welcome", method = RequestMethod.GET)
public String printWelcome(@RequestParam String who,ModelMap model) {
model.addAttribute("message", "welcome "+who);
return "hello";
}
}
本地访问该路径,如:
- http://localhost:8080/welcome
- http://localhost:8080/Welcome
则,第一个URL可以成功访问,而访问第二个URL则返