I am writing a web application that uses a JSP usebean tag in the session scope as shown below
<jsp:useBean id="userSession" class="project.session.UserSession" scope="session" />
I have also written a filter which does some processing and needs to set some values on the userSession bean. How do I get a handle onto the object and set values on it? I have tried getting the object from session as shown below, but this method doesn't work.
UserSession userSession = (UserSession)request.getSession().getAttribute("userSession");
I use Tomcat for development.