posted 17 years ago
Hi Mohammad,
The concept here is the scope of the attribute. Your code shows that you are getting some values from your previous servlet and setting them again in to the same attribute (which is not necessary).
No matter how many times you set the attributes, they have to be available for someServlet. Only then you will be able to retrieve them in the someServlet.
In your case, the atttibutes are of request scope and they will be available until your request is alive.
All that made difference in your case is the following snippet of code
<c:redirect> is nothing but you are redirecting it to some other servlet. That means, you are making a new request to some other servlet. In this case you request will be dead and new request will be sent.
So, obviously the value should be null.
instead of redirect, why dont you use reqeustDispatcher to redirect the to your someServlet... That will solve your problem.
Also, you don't need to set the attributes again. Just dispatch the request, the container will take care of making your attributes available to someServlet.
Otherwise, as kiran said, you can set your attributes at the session level to make them available through out the user session.
Hope this helps.....
[ May 17, 2008: Message edited by: Prasad Tamirisa ]