Carsten Ziegeler wrote:
Carsten Ziegeler wrote:

Reinhard Poetz wrote:

ok. Than I will try to use the standard Spring way:

<context-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

in the cocoon-22-webapp-archetype but I guess this will not work together with paranoid classloading and the reloading classloader because the listener is declared outside of Cocoon.

Yes, I noticed this problem as well. Unfortunately, listeners can't have
any parameters, so we can't provide a wrapper here (which is bad). We
could provide our own Spring-paranoid-contextloaderlistener, but I'm not
sure if this is a good idea?


What do you think, if we provide our own listener which gets a
configuration parameter from the servlet context and this parameter
contains all listener classes, so we rewrite:

<listener>
  <listener-class>packagea.classa</listener-class>
  <listener-class>packageb.classb</listener-class>
</listener>

to

<context-param>
  <param-name>o.a.c.OurListener</param-name>
  <param-value>packagea.classa,packageb.classb</param-value>
</context-param>

<listener>
  <listener-class>o.a.c.OurListener</listener-class>
</listener>

hmm, yes, this could be a general solution for people that want to add their own listeners without losing the possibility of using the paranoid classloader and the reloading classloader.

Just for Spring I prefer adding

<include-beans src="WEB-INF/applicationContext.xml"/>

to cocoon.xconf.
Is there any advantage of using a listener instead of adding beans via <include-beans/>?

--
Reinhard Pötz Independent Consultant, Trainer & (IT)-Coach
{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                       web(log): http://www.poetz.cc
--------------------------------------------------------------------

        

        
                
___________________________________________________________ Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de

Reply via email to