You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Tapestry User List <my...@gmail.com> on 2007/01/04 15:44:44 UTC
how to retrieve an Application State Object (ASO) with an application scope from the ServletContext ?
Hi,
Happy new year !!!!
I have created a class that implements ServletContextListener.
In the method public void contextDestroyed(ServletContextEvent event),
I need to retrieve an Application State Object (ASO) of tapestry 4
with an application scope (not session).
My question is how to retrieve an Application State Object (ASO) from
the ServletContext ?
public void contextDestroyed(ServletContextEvent event) {
ServletContext context = event.getServletContext();
// retrieve myApplicationObject here
}
In hivemodule.xml:
...
<contribution configuration-id="tapestry.state.ApplicationObjects">
<state-object name="myApplicationObject" scope="application">
<create-instance class="ns.MyApplicationObject"/>
</state-object>
</contribution>
...
Thanks so much,
D.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Properties Modification [Tapestry 3]
Posted by Numa Schmeder <nu...@nsconsult.net>.
Well use this plugin to configure tomcat :
http://www.sysdeo.com/eclipse/tomcatplugin
and then update your context and set reloadable="true"
But properties that leave in WEB-INf won't get reloaded. You will
have to use the contextual menu from eclipse to reload the app.
Numa
Le 5 janv. 07 à 13:39, cedric.brajus@vallourec.fr a écrit :
> I use Eclipse and I don't know how to configure automatically
> reload ? in
> the web.xml ?
> Have you an example ? because I don't what it's possible to add in
> server.xml but It's possible to configure this in my Tapestry project
>
> Please
>
>
> Cordialement - Best regards
>
> BRAJUS Cédric
> SETVAL-CTIV
> http://www.ctiv.vallourec.fr/
> Office : + 33 (0)3 27 22 76 67
> Fax : + 33 (0)3 27 22 23 00
>
>
>
> Numa Schmeder <nu...@euroconsumers.com>
> 05/01/2007 12:39
> Veuillez répondre à
> "Tapestry users" <us...@tapestry.apache.org>
>
>
> A
> "Tapestry users" <us...@tapestry.apache.org>
> cc
>
> Objet
> Re: Properties Modification [Tapestry 3]
>
>
>
>
>
>
> Well you don't have much choice then to reload ! or configure tomcat
> to automatically reload on change to .properties file.
> Numa
> Le 5 janv. 07 à 11:37, cedric.brajus@vallourec.fr a écrit :
>
>> What is the good practice for reload a properties with tapestry ?
>>
>> Example : Home.page Home.html Home_fr.properties Home_en.properties
>>
>> In my Home.html, I have : <span key="MyName"/>
>> I would like change this key in Home_fr.properties but no restart
>> tomcat
>> it's possible ?
>>
>>
>> Cordialement - Best regards
>>
>> BRAJUS Cédric
>> SETVAL-CTIV
>> http://www.ctiv.vallourec.fr/
>> Office : + 33 (0)3 27 22 76 67
>> Fax : + 33 (0)3 27 22 23 00
>>
>>
>>
>> Shing Hing Man <ma...@yahoo.com>
>> 04/01/2007 18:10
>> Veuillez répondre à
>> "Tapestry users" <us...@tapestry.apache.org>
>>
>>
>> A
>> Tapestry users <us...@tapestry.apache.org>
>> cc
>>
>> Objet
>> Re: how to retrieve an Application State Object (ASO) with an
>> application
>> scope from the ServletContext ?
>>
>>
>>
>>
>>
>>
>> I have used the following piece of code to retrieved
>> an
>> application ASO in a
>> HttpSessionListener.sessionCreated method.
>> It might work in ServletContextListener as well.
>>
>> // context is the servlet context
>> Registry registry = (Registry) context
>>
>> ..getAttribute(ApplicationServlet.REGISTRY_KEY_PREFIX_PUBLIC
>> + "(the name of ApplicationServlet given in
>> web.xml");
>>
>> ApplicationStateManager manager =
>> (ApplicationStateManager)
>>
>> registry.getService("tapestry.state.ApplicationStateManager",
>> ApplicationStateManager.class);
>> MyApplicationObject myASO =
>> (MyApplicationObject)manager.get("myApplicationObject");
>>
>>
>> HTH
>> Shing
>>
>>
>> --- Tapestry User List <my...@gmail.com>
>> wrote:
>>
>>> Hi,
>>>
>>> Happy new year !!!!
>>>
>>> I have created a class that implements
>>> ServletContextListener.
>>> In the method public void
>>> contextDestroyed(ServletContextEvent event),
>>> I need to retrieve an Application State Object (ASO)
>>> of tapestry 4
>>> with an application scope (not session).
>>>
>>> My question is how to retrieve an Application State
>>> Object (ASO) from
>>> the ServletContext ?
>>>
>>>
>>> public void contextDestroyed(ServletContextEvent
>>> event) {
>>> ServletContext context =
>>> event.getServletContext();
>>> // retrieve myApplicationObject here
>>> }
>>>
>>> In hivemodule.xml:
>>> ...
>>> <contribution
>>>
>> configuration-id="tapestry.state.ApplicationObjects">
>>> <state-object
>>> name="myApplicationObject"
>>> scope="application">
>>> <create-instance
>> class="ns.MyApplicationObject"/>
>>> </state-object>
>>> </contribution>
>>> ...
>>>
>>> Thanks so much,
>>>
>>> D.
>>>
>>>
>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail:
>>> users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail:
>>> users-help@tapestry.apache.org
>>>
>>>
>>
>>
>> Home page :
>> http://uk.geocities.com/matmsh/index.html
>>
>> Send instant messages to your online friends http://
>> uk.messenger.yahoo.com
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Properties Modification [Tapestry 3]
Posted by ce...@vallourec.fr.
I use Eclipse and I don't know how to configure automatically reload ? in
the web.xml ?
Have you an example ? because I don't what it's possible to add in
server.xml but It's possible to configure this in my Tapestry project
Please
Cordialement - Best regards
BRAJUS Cédric
SETVAL-CTIV
http://www.ctiv.vallourec.fr/
Office : + 33 (0)3 27 22 76 67
Fax : + 33 (0)3 27 22 23 00
Numa Schmeder <nu...@euroconsumers.com>
05/01/2007 12:39
Veuillez répondre à
"Tapestry users" <us...@tapestry.apache.org>
A
"Tapestry users" <us...@tapestry.apache.org>
cc
Objet
Re: Properties Modification [Tapestry 3]
Well you don't have much choice then to reload ! or configure tomcat
to automatically reload on change to .properties file.
Numa
Le 5 janv. 07 à 11:37, cedric.brajus@vallourec.fr a écrit :
> What is the good practice for reload a properties with tapestry ?
>
> Example : Home.page Home.html Home_fr.properties Home_en.properties
>
> In my Home.html, I have : <span key="MyName"/>
> I would like change this key in Home_fr.properties but no restart
> tomcat
> it's possible ?
>
>
> Cordialement - Best regards
>
> BRAJUS Cédric
> SETVAL-CTIV
> http://www.ctiv.vallourec.fr/
> Office : + 33 (0)3 27 22 76 67
> Fax : + 33 (0)3 27 22 23 00
>
>
>
> Shing Hing Man <ma...@yahoo.com>
> 04/01/2007 18:10
> Veuillez répondre à
> "Tapestry users" <us...@tapestry.apache.org>
>
>
> A
> Tapestry users <us...@tapestry.apache.org>
> cc
>
> Objet
> Re: how to retrieve an Application State Object (ASO) with an
> application
> scope from the ServletContext ?
>
>
>
>
>
>
> I have used the following piece of code to retrieved
> an
> application ASO in a
> HttpSessionListener.sessionCreated method.
> It might work in ServletContextListener as well.
>
> // context is the servlet context
> Registry registry = (Registry) context
>
> ..getAttribute(ApplicationServlet.REGISTRY_KEY_PREFIX_PUBLIC
> + "(the name of ApplicationServlet given in
> web.xml");
>
> ApplicationStateManager manager =
> (ApplicationStateManager)
>
> registry.getService("tapestry.state.ApplicationStateManager",
> ApplicationStateManager.class);
> MyApplicationObject myASO =
> (MyApplicationObject)manager.get("myApplicationObject");
>
>
> HTH
> Shing
>
>
> --- Tapestry User List <my...@gmail.com>
> wrote:
>
>> Hi,
>>
>> Happy new year !!!!
>>
>> I have created a class that implements
>> ServletContextListener.
>> In the method public void
>> contextDestroyed(ServletContextEvent event),
>> I need to retrieve an Application State Object (ASO)
>> of tapestry 4
>> with an application scope (not session).
>>
>> My question is how to retrieve an Application State
>> Object (ASO) from
>> the ServletContext ?
>>
>>
>> public void contextDestroyed(ServletContextEvent
>> event) {
>> ServletContext context =
>> event.getServletContext();
>> // retrieve myApplicationObject here
>> }
>>
>> In hivemodule.xml:
>> ...
>> <contribution
>>
> configuration-id="tapestry.state.ApplicationObjects">
>> <state-object
>> name="myApplicationObject"
>> scope="application">
>> <create-instance
> class="ns.MyApplicationObject"/>
>> </state-object>
>> </contribution>
>> ...
>>
>> Thanks so much,
>>
>> D.
>>
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail:
>> users-help@tapestry.apache.org
>>
>>
>
>
> Home page :
> http://uk.geocities.com/matmsh/index.html
>
> Send instant messages to your online friends http://
> uk.messenger.yahoo.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Properties Modification [Tapestry 3]
Posted by Numa Schmeder <nu...@euroconsumers.com>.
Well you don't have much choice then to reload ! or configure tomcat
to automatically reload on change to .properties file.
Numa
Le 5 janv. 07 à 11:37, cedric.brajus@vallourec.fr a écrit :
> What is the good practice for reload a properties with tapestry ?
>
> Example : Home.page Home.html Home_fr.properties Home_en.properties
>
> In my Home.html, I have : <span key="MyName"/>
> I would like change this key in Home_fr.properties but no restart
> tomcat
> it's possible ?
>
>
> Cordialement - Best regards
>
> BRAJUS Cédric
> SETVAL-CTIV
> http://www.ctiv.vallourec.fr/
> Office : + 33 (0)3 27 22 76 67
> Fax : + 33 (0)3 27 22 23 00
>
>
>
> Shing Hing Man <ma...@yahoo.com>
> 04/01/2007 18:10
> Veuillez répondre à
> "Tapestry users" <us...@tapestry.apache.org>
>
>
> A
> Tapestry users <us...@tapestry.apache.org>
> cc
>
> Objet
> Re: how to retrieve an Application State Object (ASO) with an
> application
> scope from the ServletContext ?
>
>
>
>
>
>
> I have used the following piece of code to retrieved
> an
> application ASO in a
> HttpSessionListener.sessionCreated method.
> It might work in ServletContextListener as well.
>
> // context is the servlet context
> Registry registry = (Registry) context
>
> ..getAttribute(ApplicationServlet.REGISTRY_KEY_PREFIX_PUBLIC
> + "(the name of ApplicationServlet given in
> web.xml");
>
> ApplicationStateManager manager =
> (ApplicationStateManager)
>
> registry.getService("tapestry.state.ApplicationStateManager",
> ApplicationStateManager.class);
> MyApplicationObject myASO =
> (MyApplicationObject)manager.get("myApplicationObject");
>
>
> HTH
> Shing
>
>
> --- Tapestry User List <my...@gmail.com>
> wrote:
>
>> Hi,
>>
>> Happy new year !!!!
>>
>> I have created a class that implements
>> ServletContextListener.
>> In the method public void
>> contextDestroyed(ServletContextEvent event),
>> I need to retrieve an Application State Object (ASO)
>> of tapestry 4
>> with an application scope (not session).
>>
>> My question is how to retrieve an Application State
>> Object (ASO) from
>> the ServletContext ?
>>
>>
>> public void contextDestroyed(ServletContextEvent
>> event) {
>> ServletContext context =
>> event.getServletContext();
>> // retrieve myApplicationObject here
>> }
>>
>> In hivemodule.xml:
>> ...
>> <contribution
>>
> configuration-id="tapestry.state.ApplicationObjects">
>> <state-object
>> name="myApplicationObject"
>> scope="application">
>> <create-instance
> class="ns.MyApplicationObject"/>
>> </state-object>
>> </contribution>
>> ...
>>
>> Thanks so much,
>>
>> D.
>>
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail:
>> users-help@tapestry.apache.org
>>
>>
>
>
> Home page :
> http://uk.geocities.com/matmsh/index.html
>
> Send instant messages to your online friends http://
> uk.messenger.yahoo.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Properties Modification [Tapestry 3]
Posted by ce...@vallourec.fr.
What is the good practice for reload a properties with tapestry ?
Example : Home.page Home.html Home_fr.properties Home_en.properties
In my Home.html, I have : <span key="MyName"/>
I would like change this key in Home_fr.properties but no restart tomcat
it's possible ?
Cordialement - Best regards
BRAJUS Cédric
SETVAL-CTIV
http://www.ctiv.vallourec.fr/
Office : + 33 (0)3 27 22 76 67
Fax : + 33 (0)3 27 22 23 00
Shing Hing Man <ma...@yahoo.com>
04/01/2007 18:10
Veuillez répondre à
"Tapestry users" <us...@tapestry.apache.org>
A
Tapestry users <us...@tapestry.apache.org>
cc
Objet
Re: how to retrieve an Application State Object (ASO) with an application
scope from the ServletContext ?
I have used the following piece of code to retrieved
an
application ASO in a
HttpSessionListener.sessionCreated method.
It might work in ServletContextListener as well.
// context is the servlet context
Registry registry = (Registry) context
..getAttribute(ApplicationServlet.REGISTRY_KEY_PREFIX_PUBLIC
+ "(the name of ApplicationServlet given in
web.xml");
ApplicationStateManager manager =
(ApplicationStateManager)
registry.getService("tapestry.state.ApplicationStateManager",
ApplicationStateManager.class);
MyApplicationObject myASO =
(MyApplicationObject)manager.get("myApplicationObject");
HTH
Shing
--- Tapestry User List <my...@gmail.com>
wrote:
> Hi,
>
> Happy new year !!!!
>
> I have created a class that implements
> ServletContextListener.
> In the method public void
> contextDestroyed(ServletContextEvent event),
> I need to retrieve an Application State Object (ASO)
> of tapestry 4
> with an application scope (not session).
>
> My question is how to retrieve an Application State
> Object (ASO) from
> the ServletContext ?
>
>
> public void contextDestroyed(ServletContextEvent
> event) {
> ServletContext context =
> event.getServletContext();
> // retrieve myApplicationObject here
> }
>
> In hivemodule.xml:
> ...
> <contribution
>
configuration-id="tapestry.state.ApplicationObjects">
> <state-object name="myApplicationObject"
> scope="application">
> <create-instance
class="ns.MyApplicationObject"/>
> </state-object>
> </contribution>
> ...
>
> Thanks so much,
>
> D.
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail:
> users-help@tapestry.apache.org
>
>
Home page :
http://uk.geocities.com/matmsh/index.html
Send instant messages to your online friends http://uk.messenger.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: how to retrieve an Application State Object (ASO) with an application scope from the ServletContext ?
Posted by Shing Hing Man <ma...@yahoo.com>.
I have used the following piece of code to retrieved
an
application ASO in a
HttpSessionListener.sessionCreated method.
It might work in ServletContextListener as well.
// context is the servlet context
Registry registry = (Registry) context
.getAttribute(ApplicationServlet.REGISTRY_KEY_PREFIX_PUBLIC
+ "(the name of ApplicationServlet given in
web.xml");
ApplicationStateManager manager =
(ApplicationStateManager)
registry.getService("tapestry.state.ApplicationStateManager",
ApplicationStateManager.class);
MyApplicationObject myASO =
(MyApplicationObject)manager.get("myApplicationObject");
HTH
Shing
--- Tapestry User List <my...@gmail.com>
wrote:
> Hi,
>
> Happy new year !!!!
>
> I have created a class that implements
> ServletContextListener.
> In the method public void
> contextDestroyed(ServletContextEvent event),
> I need to retrieve an Application State Object (ASO)
> of tapestry 4
> with an application scope (not session).
>
> My question is how to retrieve an Application State
> Object (ASO) from
> the ServletContext ?
>
>
> public void contextDestroyed(ServletContextEvent
> event) {
> ServletContext context =
> event.getServletContext();
> // retrieve myApplicationObject here
> }
>
> In hivemodule.xml:
> ...
> <contribution
>
configuration-id="tapestry.state.ApplicationObjects">
> <state-object name="myApplicationObject"
> scope="application">
> <create-instance class="ns.MyApplicationObject"/>
> </state-object>
> </contribution>
> ...
>
> Thanks so much,
>
> D.
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail:
> users-help@tapestry.apache.org
>
>
Home page :
http://uk.geocities.com/matmsh/index.html
Send instant messages to your online friends http://uk.messenger.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org