controller获取userid HttpSession session = request.getSession(); I nteger userId = (Integer)session.getAttribute("userId");