springMVC获得HttpServletRequest对象

在springMVC的controller中获得HttpServletRequest对象

@RequestMapping("/test")

@ResponseStatus(HttpStatus.NO_CONTENT)

public void test(HttpServletRequest request){

    System.out.println(request.getServletPath());

}

 

你可能感兴趣的:(springMVC获得HttpServletRequest对象)