You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Klaus Drechsler <dr...@gmx.net> on 2001/01/03 14:35:48 UTC

How can I use my own java classes?

Hi,

I can´t find the xbean taglib in C2, so how can I use my
own java classes in cocoon 2?

Bye,
  Klaus

--------------------------------------
Farewell! I will omit no opportunity
That may convey my greetings, love, to thee.
Romeo&Juliet
                         (Act III, Scene V)
--------------------------------------
PGP-Key: http://www.kdnet.de/pgp


Re: How can I use my own java classes?

Posted by Klaus Drechsler <dr...@gmx.net>.
At 23:05 03.01.01, you wrote:

>To use the classes in XSP, you simply need to add this
>directly after your xsp:page tag:

Thank you very much!

bye,
  Klaus

--------------------------------------
Farewell! I will omit no opportunity
That may convey my greetings, love, to thee.
Romeo&Juliet
                         (Act III, Scene V)
--------------------------------------
PGP-Key: http://www.kdnet.de/pgp


Re: How can I use my own java classes?

Posted by Berin Loritsch <bl...@apache.org>.
Klaus Drechsler wrote:

> Hi,
> 
>> Add them to the classloader (which is usually the
>> /WEB-INF/classes directory).
> 
> 
> I am using T4-m5 and C2 and ther is no /webapps/cocoon/WEB-INF/classes
> directory.
> 
> Should I create it?
> 
> And how do I use these java classes?

Yes, create it.  If you have a jar with your own classes,
then place it in the /webapps/cocoon/WEB-INF/lib directory
with all the other Cocoon jars.

To use the classes in XSP, you simply need to add this
directly after your xsp:page tag:

<xsp:structure>
   <xsp:include>fully.qualified.class.name</xsp:include>
   <!-- Note: one xsp:include per class or package -->
</xsp:structure>

You can now instantiate and manipulate all of your included
classes inside of xsp:logic tags.


Re: How can I use my own java classes?

Posted by Klaus Drechsler <dr...@gmx.net>.
Hi,

>Add them to the classloader (which is usually the
>/WEB-INF/classes directory).

I am using T4-m5 and C2 and ther is no /webapps/cocoon/WEB-INF/classes
directory.

Should I create it?

And how do I use these java classes?

ciao,
  Klaus

--------------------------------------
Farewell! I will omit no opportunity
That may convey my greetings, love, to thee.
Romeo&Juliet
                         (Act III, Scene V)
--------------------------------------
PGP-Key: http://www.kdnet.de/pgp


Re: How can I use my own java classes?

Posted by Berin Loritsch <bl...@apache.org>.
Klaus Drechsler wrote:

> Hi,
> 
> I can´t find the xbean taglib in C2, so how can I use my
> own java classes in cocoon 2?
> 
> Bye,
>  Klaus
> 
> --------------------------------------
> Farewell! I will omit no opportunity
> That may convey my greetings, love, to thee.
> Romeo&Juliet
>                         (Act III, Scene V)
> --------------------------------------
> PGP-Key: http://www.kdnet.de/pgp
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org

Add them to the classloader (which is usually the
/WEB-INF/classes directory).  In XSP you can do the
following (note: please change the namespace for the
proper version of Cocoon that you are using):

<xsp:page language="java"
           xmlns="http://apache.org/xsp"
 >

<xsp:structure>
   <xsp:include>my.class.Here</xsp:include>
   <xsp:include>my.other.class.There</xsp:include>
</xsp:structure>

<mypage>
   <xsp:logic>
     Here here = new Here();
     There there = new There();

     here.doSomething();

     if (there.isSomethingWrong()) {
         here.shootMe();
     }
   </xsp:logic>
   <my-markup>
     <p>Ha Ha Ha</p>
   </my-markup>
</mypage>
</xsp:page>