struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Mitchell" <jmitch...@apache.org>
Subject Re: scope of a tool
Date Sun, 02 Feb 2003 15:20:08 GMT
Are you talking about Velosurf?


--
James Mitchell





----- Original Message -----
From: "Aislan Fernandes" <aislanfp@ig.com.br>
To: <struts-user@jakarta.apache.org>
Sent: Saturday, February 01, 2003 7:22 AM
Subject: scope of a tool


> hi again,
>
> Before i have said about scope of a tool and seem that nobody undestood me
> (my question), but now i have a text about this:
>
> "the scope of the tool (as specified in your toolbox.xml) determines when
> your tool is created and what data is passed to the init() method (if an
> instance of ViewTool).
>
>     a.  if the scope is "request", then a new instance of the tool is
> created for each request (and lives only that long).  it will be
> instantiated with the current ViewContext (which is a ChainedContext when
> using the provided servlets).
>     b. if the scope is "session", then the tool is created and initialized
> only once for session.  if a ViewTool, then init() will be passed the
> ViewContext that is current for the request on which the session tools are
> first made.  you should also note that since session tools are kept in a
> HashMap within the session object, it is recommended (but not necessary)
> that they be serializable.
>     c. "application" scoped tools are instantiated when the toolbox
manager
> is first loaded (at servlet init time).  if these implement the ViewTool
> interface, then the init() method will be passed the ServletContext to
give
> access to application resources."
>
> so, the my question is: is right the code below?
>
> <toolbox>
>   <tool>
>      <key>requer</key>
>      <class>RequerTool</class>
>   </tool>
>   <tool scope="session">
>      <key>user</key>
>      <class>UserTool</class>
>   </tool>
>   <tool scope="application">
>      <key>app</key>
>      <class>AplicationTool</class>
>   </tool>
> </toolbox>
>
> _________________________________________________________
> Voce quer um iGMail protegido contra vĂ­rus e spams?
> Clique aqui: http://www.igmailseguro.ig.com.br
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message