cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shai200 <shai...@gmail.com>
Subject Loading ApplicationContext class when Jetty starts
Date Wed, 26 Mar 2008 04:16:42 GMT


I have a Preloader class which implements ServletContextListener and
initializes an object of a class called ApplicationContext in which I
aggregate application-level objects.

Is there a native way to do this in Cocoon (i.e. store objects in the
application context?)

In any case, I tried to have the Preloader load by creating a
preloaders.properties file under
src/main/resources/META-INF/cocoon/properties with the following content:
org.apache.cocoon.classloader.load.classes.preloader=com.elintegro.skunk.config.Preloader

This doesn't seem to be loading this class when Jetty runs. It does nothing.

Help?



Grzegorz Kossakowski-2 wrote:
> 
> shai200 pisze:
>> Hello,
> 
> Hello
> 
>> The following POM goal:
>> 
>> mvn cocoon:rcl
>> 
>> Implies that web.xml, applicationContext.xml, and the rest of the stuff
>> in
>> webapp/WEB-INF is automatically generated by maven... But how do I
>> edit/modify them? Do I do it through the POM or is there some kind of way
>> to
>> tell maven to use my own file?
> 
> See here:
> http://cocoon.apache.org/2.2/maven-plugins/maven-plugin/1.0/1360_1_1.html
> 
>> My second question is - how do I define a particular class to load when
>> the
>> web server loads, when I use the Jetty webapp container example from the
>> Cocoon2 getting started guides? Do I do this through web.xml or
>> applicationContext.xml, or perhaps by editing the POM file?
> 
> Hmmm, if you want to just load it you should use the features mentioned
> here:
> http://cocoon.apache.org/2.2/blocks/databases/1.0/1409_1_1.html
> 
> There you have instructions how to load HSQL driver, but this mechanism is
> general so you can create 
> properties file with name whatever you like and use format:
> org.apache.cocoon.classloader.load.classes.[some_group_id]=[full_name_of_class]
> 
> Where some_group_id is of your choice.
> 
> 
> I hope this helps you a little bit.
> 
> -- 
> Grzegorz Kossakowski
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Modifying-web.xml---loading-a-class-when-application-starts-tp16104032p16295409.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message