//获取requert
HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest();
String defaultimg = request.getSession().getServletContext().getRealPath("/") +"static"+File.separator+"img"+File.separator+"defaultimg.jpg";