All default variables that are exposed by the jsp engine
are not accessible inside <%! %>.

Have a look at the generated source and you get a better 
understanding what happens:

class foo ... {
   public void _jspService(...) {
     ...
     HttpSession session = null;
     ...
   }
   public void jspDestroy() {
     // Doesn't see session
   }
}

So session (and all other implicit variables) are local 
to the _jspService method.

To solve your problem you are on the wrong path.

What solves the problem depends on what you mean with 
'leave a page'. If you just wan't to perform an action 
after every thing else is done on the page you can use 
a try/finally block to do it.

  <%
     try {
  %>
  Some HTML + Scriplets + expressions
  <%
     } finally {
       // No matter what happens in the try block
       // Do what ever should be done a last part of the request
     }
  %>

If you mean a user has clicked to another page, there is nothing 
you can do in the current jsp to do a clean up. 

The jsp_destroy method is called under conditions, that doesn't 
have anything to do with the action a user performs.

If you want something like that, you have to perform the cleanup 
in the other page or you have implement a filter that will do the 
cleanup.

Maybe you mean something complete different ? Then you should 
provide more info about what the intentions why and when you want 
to delete the property.

> -----Ursprüngliche Nachricht-----
> Von: Raphael Di Cicco [mailto:[EMAIL PROTECTED]]
> Gesendet: Freitag, 5. Juli 2002 11:21
> An: Tomcat Users List
> Betreff: JSP destroy problem
> 
> But it seems I have no access to session :
> 
> "Undefined variable or class name: session"
> 
> Anyone have any idea how to do that ?
> 

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to