胡说叔叔
直接在方法上使用 HttpSession即可注入; 或者注入HttpServletRequest--->再获取Sessionpublic static HttpSession getSession() {HttpSession session = null;try {session = getRequest().getSession();} catch (Exception e) {}return session;}public static HttpServletRequest getRequest() {ServletRequestAttributes attrs = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();return attrs.getRequest();}通过上述两个方法获取,减少了方法中的参数个数