Object value = request.getSession().getAttribute("nameOfTheAttributeUsedInTheFirstServlet");
If two servlets are in the same webapp, they use the same session context, and the session is the same for both servlets. Of course, remember that a session is limited to a specific user.
source
share