You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by mauro2java2011 <ma...@gmail.com> on 2014/12/15 11:36:25 UTC

write and use custom ContectLoaderListener

Hi. I would write i custom ContextListener. 

If i understand it is calked when tge server classloader load the web app. 

Now i would set SystemProoertues fir use into webapplication. 
The ServletCobtextListener is called after tge context is loaded and so not
is ok.

Wgat classvi gave to extends for cystom ContextLiaderListebet and hie i can
cobfugure systemprioerties and services loader for use only with the web app
loaded  ?

How configure into web.xml or only add into meta-inf context.xml ?
Mauro





--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/write-and-use-custom-ContectLoaderListener-tp4673224.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: write and use custom ContectLoaderListener

Posted by Romain Manni-Bucau <rm...@gmail.com>.
2014-12-15 11:55 GMT+01:00 mauro2java2011 <ma...@gmail.com>:
> tabk you for your response.
>
> So i can use The ServletContainerInitializer
> <http://docs.oracle.com/javaee/6/api/javax/servlet/ServletContainerInitializer.html>
>
> <http://docs.oracle.com/javaee/6/api/javax/servlet/ServletContainerInitializer.html>
> for set StemProperties for configure jaas and set so the login.config from
> inside WEB_INF dir of web application without put into conf dir of tomee?
>
> how i have to register the ServletContainerInitializer
> <http://docs.oracle.com/javaee/6/api/javax/servlet/ServletContainerInitializer.html>
> ???? into contect.xml?
>

No as explained in the link it is a standard SPI 'META-INF/services/...

PS: using an ejb @Singleton @Startup with @PostConstruct should work as well

>
> <http://docs.oracle.com/javaee/6/api/javax/servlet/ServletContainerInitializer.html>
>
>
>
> 2014-12-15 11:45 GMT+01:00 Romain Manni-Bucau [via TomEE & OpenEJB] <
> ml-node+s979440n4673225h50@n4.nabble.com>:
>>
>> use a ServletContainerInitializer
>> (
>> http://docs.oracle.com/javaee/6/api/javax/servlet/ServletContainerInitializer.html).
>>
>> For spring you have WebApplicationInitializer and @Order.
>>
>>
>> Romain Manni-Bucau
>> @rmannibucau
>> http://www.tomitribe.com
>> http://rmannibucau.wordpress.com
>> https://github.com/rmannibucau
>>
>>
>> 2014-12-15 11:36 GMT+01:00 mauro2java2011 <[hidden email]
>> <http:///user/SendEmail.jtp?type=node&node=4673225&i=0>>:
>>
>> > Hi. I would write i custom ContextListener.
>> >
>> > If i understand it is calked when tge server classloader load the web
>> app.
>> >
>> > Now i would set SystemProoertues fir use into webapplication.
>> > The ServletCobtextListener is called after tge context is loaded and so
>> not
>> > is ok.
>> >
>> > Wgat classvi gave to extends for cystom ContextLiaderListebet and hie i
>> can
>> > cobfugure systemprioerties and services loader for use only with the web
>> app
>> > loaded  ?
>> >
>> > How configure into web.xml or only add into meta-inf context.xml ?
>> > Mauro
>> >
>> >
>> >
>> >
>> >
>> > --
>> > View this message in context:
>> http://tomee-openejb.979440.n4.nabble.com/write-and-use-custom-ContectLoaderListener-tp4673224.html
>> > Sent from the TomEE Users mailing list archive at Nabble.com.
>>
>>
>> ------------------------------
>>  If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://tomee-openejb.979440.n4.nabble.com/write-and-use-custom-ContectLoaderListener-tp4673224p4673225.html
>>  To unsubscribe from write and use custom ContectLoaderListener, click
>> here
>> <http://tomee-openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4673224&code=bWF1cm8yamF2YTIwMTFAZ21haWwuY29tfDQ2NzMyMjR8LTExMTcxODc2MjU=>
>> .
>> NAML
>> <http://tomee-openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.n4.nabble.com/write-and-use-custom-ContectLoaderListener-tp4673224p4673226.html
> Sent from the TomEE Users mailing list archive at Nabble.com.

Re: write and use custom ContectLoaderListener

Posted by mauro2java2011 <ma...@gmail.com>.
tabk you for your response.

So i can use The ServletContainerInitializer
<http://docs.oracle.com/javaee/6/api/javax/servlet/ServletContainerInitializer.html>

<http://docs.oracle.com/javaee/6/api/javax/servlet/ServletContainerInitializer.html>
for set StemProperties for configure jaas and set so the login.config from
inside WEB_INF dir of web application without put into conf dir of tomee?

how i have to register the ServletContainerInitializer
<http://docs.oracle.com/javaee/6/api/javax/servlet/ServletContainerInitializer.html>
???? into contect.xml?


<http://docs.oracle.com/javaee/6/api/javax/servlet/ServletContainerInitializer.html>



2014-12-15 11:45 GMT+01:00 Romain Manni-Bucau [via TomEE & OpenEJB] <
ml-node+s979440n4673225h50@n4.nabble.com>:
>
> use a ServletContainerInitializer
> (
> http://docs.oracle.com/javaee/6/api/javax/servlet/ServletContainerInitializer.html).
>
> For spring you have WebApplicationInitializer and @Order.
>
>
> Romain Manni-Bucau
> @rmannibucau
> http://www.tomitribe.com
> http://rmannibucau.wordpress.com
> https://github.com/rmannibucau
>
>
> 2014-12-15 11:36 GMT+01:00 mauro2java2011 <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=4673225&i=0>>:
>
> > Hi. I would write i custom ContextListener.
> >
> > If i understand it is calked when tge server classloader load the web
> app.
> >
> > Now i would set SystemProoertues fir use into webapplication.
> > The ServletCobtextListener is called after tge context is loaded and so
> not
> > is ok.
> >
> > Wgat classvi gave to extends for cystom ContextLiaderListebet and hie i
> can
> > cobfugure systemprioerties and services loader for use only with the web
> app
> > loaded  ?
> >
> > How configure into web.xml or only add into meta-inf context.xml ?
> > Mauro
> >
> >
> >
> >
> >
> > --
> > View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/write-and-use-custom-ContectLoaderListener-tp4673224.html
> > Sent from the TomEE Users mailing list archive at Nabble.com.
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://tomee-openejb.979440.n4.nabble.com/write-and-use-custom-ContectLoaderListener-tp4673224p4673225.html
>  To unsubscribe from write and use custom ContectLoaderListener, click
> here
> <http://tomee-openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4673224&code=bWF1cm8yamF2YTIwMTFAZ21haWwuY29tfDQ2NzMyMjR8LTExMTcxODc2MjU=>
> .
> NAML
> <http://tomee-openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/write-and-use-custom-ContectLoaderListener-tp4673224p4673226.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: write and use custom ContectLoaderListener

Posted by Romain Manni-Bucau <rm...@gmail.com>.
use a ServletContainerInitializer
(http://docs.oracle.com/javaee/6/api/javax/servlet/ServletContainerInitializer.html).
For spring you have WebApplicationInitializer and @Order.


Romain Manni-Bucau
@rmannibucau
http://www.tomitribe.com
http://rmannibucau.wordpress.com
https://github.com/rmannibucau


2014-12-15 11:36 GMT+01:00 mauro2java2011 <ma...@gmail.com>:
> Hi. I would write i custom ContextListener.
>
> If i understand it is calked when tge server classloader load the web app.
>
> Now i would set SystemProoertues fir use into webapplication.
> The ServletCobtextListener is called after tge context is loaded and so not
> is ok.
>
> Wgat classvi gave to extends for cystom ContextLiaderListebet and hie i can
> cobfugure systemprioerties and services loader for use only with the web app
> loaded  ?
>
> How configure into web.xml or only add into meta-inf context.xml ?
> Mauro
>
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.n4.nabble.com/write-and-use-custom-ContectLoaderListener-tp4673224.html
> Sent from the TomEE Users mailing list archive at Nabble.com.