cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robby Pelssers" <robby.pelss...@ciber.com>
Subject RE: Adding my Java code to flowscript
Date Tue, 25 Jan 2011 06:17:35 GMT
importClass(Packages.java.util.ArrayList);

function search() {
    var list = new ArrayList();
    ...
}

Kind regards,
Robby Pelssers


-----Oorspronkelijk bericht-----
Van: Des Magner [mailto:des@icandriveatractor.com]
Verzonden: zo 23-1-2011 1:25
Aan: users@cocoon.apache.org
Onderwerp: Adding my Java code to flowscript
 
Hi

I am trying to add some custom code to be called from my flowscript but 
with no success. I followed the instructions in the user documentation 
to the letter (http://cocoon.apache.org/2.1/userdocs/flow/java.html). I 
have added my source directory entry to the component-instance in the 
format "file:/path/to/my/source" but it doesn't seem to want to pick up 
the code. Say I have the following code in my flowscript:

var resource = new Packages.Test();

with the file Test.java placed in my source dir as specified above, I 
consistently get the following error:

org.mozilla.javascript.EvaluatorException: "file:///....js", line ..: 
Not a Java class: [JavaPackage Test]

I can get around it by placing the compiled class in the 
cocoon/WEB-INF/classes directory but this is not a very elegant solution.

Any help would be greatly appreciated.
Thanks
Des

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



Mime
View raw message