You should use the encodeRedirectURL() method in conjunction with sendRedirect() when redirecting to another part of your website. This must be done in order to property retain the session ID. From the JavaEE API:
All URLs sent to the HttpServletResponse.sendRedirect method should be run through this method. Otherwise, URL rewriting cannot be used with browsers which do not support cookies.
Can you also post the code that sets the attribute? If the attribute name you're using to set the attribute doesn't match the name you're using to get the attribute, then it would make sense that it's returning null.
Joined: Jul 09, 2010
I have even try using forward but still its not working.
Below is the link where i was discussing the issue :