我发送以下http请求:
http://localhost:8081/member/createCompany/getSmallThumbnail/
在服务器端,我进入了控制器方法:
@RequestMapping("/error")
public String error(Model model, HttpServletRequest request){
if(request.getRequestURI().contains("thumbnail")){
System.out.println("thumbnail accepted");
}
request.toString();
model.addAttribute("message", "page not found");
return "errorPage";
}
在这种方法中,我想知道请求到达的 url。
但我在请求中找不到将返回此的方法。
请帮助返回我想要的网址。
附言
实际上,我没有在我的 spring mvc 应用程序(url 已损坏)中为http://localhost:8081/member/createCompany/getSmallThumbnail/
. 此 url("/error") 在 web.xml 中配置为错误页面。