This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
hi I am using form based authentication and I have a filter to do some post-login. The post-login part involves returning a value object which I want to put in session. But since the doFilter() method of the Filter has ServletRequest and ServletResponse instead of the HttpServletRequest and HttpServletResponse, I cannot use the getSession() method.
Is there another way to put my value object in session?
here's the code snippet to get a clearer view of wht i m trying to do--
I belive you should be able to cast the request passed in to you doFilter method to a HttpServletRequest - providing that is what it actually is. Have you tried this? did you get a ClassCastException because it was actually something else?
Best Wishes, Louise
Joined: Aug 07, 2004
Yes casting works as far as compilation goes. But my question is will the session obtain the Browser Id and all the parameters that is required to maintain the session??
Does the ServletRequest have all tht info ...if it does then we can surely cast it to HttpServletRequest...but if not then i think it will give a runtime error !!