Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_jsp thread: jsp:useBean


Message #1 by "java.list" <java.list@u...> on Wed, 16 Oct 2002 16:35:24 -0300
It's a bit pointless to release a variable in a JSP when you have scope set
to 'session'. Having a session scope implies that the variable will be used
to transfer information (or at least maintain state) across requests.

I try to remember to always set variables to null when no longer needed (and
properly cleaned out of course, if needed). At the very least it will
prevent you from accidentally using a variable containing bogus information
(you'd have to re-initiate it first or get a NullPointerException) and it
may help the garbage collector as well.

> -----Original Message-----
> From: java.list [mailto:java.list@u...]
> Sent: Wednesday, October 16, 2002 21:35
> To: Pro_JavaServer_Pages
> Subject: [pro_jsp] jsp:useBean
>
>
> Example JSP:
>
> <jsp:useBean id="Tabela" class="work.analise.Tabela"
> scope="session"/>
> <jsp:setProperty name="Tabela" property="*" />
> .
> .
> .
> 	Tabela.critica();
> 	Tabela.salvar();
> .
> .
> .
>
> It is necessary in the end of the JSP, Tabela = null to
> liberate resources?
>
> []'s
> Rodrigo
>
>
> ---
> UOL Eleições 2002 - Todos os lances da disputa política
> http://eleicoes.uol.com.br/
>
>


  Return to Index