Hi,
 
in my project, I produced a jar file containing all class files and put it into webapps/cocoon/WEB-INF/lib. The path of the class files in the jar must match your definition in the sitemap. For ant, take a look at: http://jakarta.apache.org/ant/
 
Regards,
Elmar
 

 -----Ursprüngliche Nachricht-----
Von: Anna Afonchenko [mailto:[EMAIL PROTECTED]]
Gesendet: Mittwoch, 18. Dezember 2002 11:43
An: [EMAIL PROTECTED]
Betreff: Re: problem in writing Actions

Hi Sternath.
Thanks for the answer.
So, if I get it right, I need to compile the java file and put the resulting class file into the cocoon
directory? I don't need to put the class into some subdirectory of cocoon?
And can you tell me where can I get this Ant?
 
Thanks for help.
Anna
----- Original Message -----
Sent: Wednesday, December 18, 2002 12:34 PM
Subject: AW: problem in writing Actions

Hi Anna,
 
the .java file has to be compiled into a class file. Cocoon then accesses the class file to execute the desired functionality. For compilation, you need an appropriate tool, for instance ant. I would recommend to get familiar with ant. Ant provides functionality to compile .java files into .class files, pack them into .jar libraries and deploy them into the target directory of cocoon.
 
Regards,
Elmar
-----Ursprüngliche Nachricht-----
Von: Anna Afonchenko [mailto:[EMAIL PROTECTED]]
Gesendet: Mittwoch, 18. Dezember 2002 11:22
An: cocoon-users
Betreff: problem in writing Actions

Hi all.
I am exploring the action possibilities in Cocoon now, and I wanted to test some actions.
I took sample action class RandomAction.java (from book "Cocoon:Building XML Applications" by Langham & Ziegeler), changed the package name to ub, and copied this file into ub directory under cocoon directory. Then I declared it in a sitemap by adding
<map:action name="random" src=""/>
 
When I try to use it (even if I just call http://localhost:8080/cocoon/ and not the pattern match for this action), I get an error from Cocoon:

type fatal

message Error in sitemap configuration : ub.RandomAction

description org.apache.avalon.framework.configuration.ConfigurationException: Error in sitemap configuration : ub.RandomAction

sender org.apache.cocoon.servlet.CocoonServlet

source Cocoon servlet

request-uri

/cocoon/

I tried to move the RandomAction.java to the cocoon directory, it doesn't help.

What should I do and where should I put my own Action class in order to use it in the sitemap?

Thank you very much for help.

Anna

Reply via email to