Monday, March 4, 2013

Get Session Data in Java

Application app = welcomePage.getCallingWindow().getApplication();
                WebApplicationContext ctx = (WebApplicationContext) app
                        .getContext();
                HttpSession session = ctx.getHttpSession();
                int userId = (Integer) session.getAttribute("userID");
                rp.setUser(userId);

No comments:

Post a Comment