I am implementing shopping cart demo. & storing the items using the hash table. I am using an integer variable(iItems) to count the number of items in the cart.
If i am pressing the logout button in .jsp , i am making the session variables invalidate but iItems(Count integer variables) do not make becomes null in my servlet.
I declared iItems=0 , above my service method in servlet. I can't declare iItems inside the service method in servlet because my add & delete functionality will not work.
So, when new user log in he is getting the count(iItems) of the previous session not starting with iItems=0.
Can anyone provide me the solution how to make my iItems(Count integer variables) in servlet as zero.
If i am pressing the logout button in .jsp , i am making the session variables invalidate but iItems(Count integer variables) do not make becomes null in my servlet.
I declared iItems=0 , above my service method in servlet. I can't declare iItems inside the service method in servlet because my add & delete functionality will not work.
So, when new user log in he is getting the count(iItems) of the previous session not starting with iItems=0.
Can anyone provide me the solution how to make my iItems(Count integer variables) in servlet as zero.