/** * 清空所有request session属性 */ public static void initSession(HttpSession session,HttpServletRequest request) { Enumeration<String> attributeNames = request.getAttributeNames(); while (attributeNames.hasMoreElements()) { request.removeAttribute(attributeNames.nextElement()); } Enumeration<String> em = session.getAttributeNames(); while (em.hasMoreElements()) { session.removeAttribute(em.nextElement()); } }
清空request session里面所有缓存的内容
最新推荐文章于 2023-12-23 14:56:35 发布