jsp - How to remove session attribute on jspDestroy() method -


i want remove session attribute when jsp page destroyed. problem can not call request.getsession() on jspdestroy() method. compilation error:

public void jspdestroy() {   request.getsession().removeattribute("key"); } 

error: request can not resolved!

is there way remove session attribute after jsp page destroy?

the jspdestroy() method called when jsp container shut down , not after processing each request.

so doesn't have access of implicit jsp objects (request, response) (since local variables in _jspservice() method).

so, cannot access request , response implicit objects in jspdestroy() (because there no logical explanation why that). destruction phase of jsp life cycle when jsp being removed use container (web server).

in case, suspect logic incorrect. think should reconsider when session attribute removed...


Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -