cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robin Green" <gree...@hotmail.com>
Subject Re: Hint for Cocoon and Corba ?
Date Thu, 19 Oct 2000 11:19:53 GMT
Sylvain Wallez <wallez.anyware@free.fr> wrote:
>Another solution is to subclass the Cocoon servlet and do your
>initialisation stuff as previously in the init method of the subclass
>before calling super.init.
>
>Of course, the servlet to register in the servlet engine will be your
>subclass instead of Cocoon.

This is unnecessarily complicated (you have to rebuild cocoon, and rebuild 
again every time you upgrade cocoon). The solution I originally posted was 
for per-page initialization. If you want per-Cocoon initialization, just put

<xsp:logic>
{ Class.forName ("mypackage.MySiteInit"); }
</xsp:logic>

in every appropriate page, and then define a class in MySiteInit.java like 
so:

package mypackage;
public class MySiteInit {
static {
   // .. your initialization here
}
}


remembering to compile that and put it on the classpath.


>
>-Sylvain
>
>Robin Green a écrit :
> >
> > "Jean Louis FEREY" <jlferey@tf1.fr> wrote:
> > >(sorry in advance for my "rookie question")
> >
> > No problem. It's not a very FAQ , which makes a change! :)
> >
> > >
> > >My Corba ORB is Visibroker, I want to make a corba client in XSP (with
> > >xsp:logic).
> > >
> > >In the past, I made that with a servlet and I put the initialization of 
>the
> > >orb [org.omg.CORBA.ORB.init()] in the init method of my servlet. I done
> > >that because I wanted to init the ORB only one time during the life of 
>my
> > >servlet.
> > >
> > >I don't know how to do the same thing with cocoon and XSP. Do I have to
> > >make a producer ? and How ?
> >
> > No, you don't have to make a producer. There are several ways to do
> > once-only code in XSP, the simplest is
> >
> > <xsp:logic>
> > {
> >    // your code here
> > }
> > </xsp:logic>
> >
> > but make sure to put this OUTSIDE your page root element but inside
> > <xsp:page>.
> >
> > This is what's known as an "instance initializer".
> >
> > 
>_________________________________________________________________________
> > Get Your Private, Free E-mail from MSN Hotmail at 
>http://www.hotmail.com.
> >
> > Share information about yourself, create your own public profile at
> > http://profiles.msn.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> > For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>--
>Salutations / Best regards
>
>Sylvain Wallez
>Anyware Technologies
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>For additional commands, e-mail: cocoon-users-help@xml.apache.org
>

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


Mime
View raw message