汪汪一只猫
public 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();}通过上述两个方法获取,减少了方法中的参数个数