Eshwin Sukhdeve wrote:you can use RequestDispatcher to forward to another servlet.if the data exist in request object
but i have to pass a value(to another servlet) which i got from another servlet using session object.......
i have to pass this value of n to another servlet so that i can use it in another servlet....
i am using Request dispatcher through following code but null value is retrieved that is following error is showed.
anull.pdf is not found as pdf or resource
Anurag Verma wrote:set the data into request attributes & fetch it back into next servlet. ie on first servlet, write -
& in second servlet, write -
Object valueObject = request.getAttribute("key");
i have done it but null value is being passed...
Anurag Verma wrote:attributes in a servlet remains only till the instance of request (in which we have put the attribute) is alive. once the response is sent, it wont be available (even on further requests by same client.). what exactly are you doing & what exactly do you want??
i was doing some mistake now it is running