String username = (String) request.getAttribute("username");
CustomObject obj = (CustomObject) request.getAttribute("customObj");
HttpSession session = request.getSession(); String username = (String) session.getAttribute("username");This code retrieves the value of the "username" attribute set in a previous request's session object. The package library for HttpServletRequest.getAttribute() is the javax.servlet.http package.