一般我们在Controller层,会编写类似这样的方法 @Controller @RequestMapping(value="/detail") public class GetURIDetailController { @SystemControllerLog(description = "id") @RequestMapping(value="/{id}",method={RequestMethod.GET}) public ModelAnd…
在使用spring进行web开发的时候,优势会用到request对象,用来获取访问ip.请求头信息等 这里收集几种获取request对象的方式 方法一:在controller里面的加参数 public class BaseController{ @RequestMapping("/test") public void test(HttpServletRequest request){//使用参数注入request } } 这里将controller层的方法中注入参数,spring就会给…