Well please clearify your question first ... I cant figure out that where u have to clear the session and why? You want to clear the session when u enter this page or when u are about to leave this page ??? One for thing i want to add that if ur cookies are not enabled then session whould not work, so please do check your browser configuration also using session.invalidate(); sometimes doesnot remove attributes from the session so it is a good practice to use session.removeAttribute(...); function explicity to remove attributes from the session .
Imran, Thanks for your reply and information. I have a couple of forms that get sent to a servlet, calculations are done and the information is available in the session, this all works fine. But I just want to be able to reset the form fields, just as a normal (html) reset does,not end the session, at this time, but they may want to update or change the data, hit submit and get a new set of calculations. so.. AveSal.value = ''; would become? <%=session.removeAttribute("AveSal") %> ??
I get your point ... Well if u want to give an option for resent den u should explicitly remove the attributes that the servlet set using: session.removeAttribute("Avgsal"); Well mary if u r having any futhur problems resenting the session then plz do ask again and again until u r dont solving them.
OCP, SCJP2, SCWCD
I AM MIGHTY! Especially when I hold this tiny ad:
a bit of art, as a gift, the permaculture playing cards