cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robby Pelssers" <>
Subject RE: classes in block / usage in flowscript
Date Thu, 04 Jun 2009 11:36:31 GMT
The proper way to access java from flowscript is to import the classes
at the top:


then you can do this:
var myclass = new MyClass();

This should work if at least that package is included in the classpath.

And if you want to access beans, you should not use this construction,
neither is importing the class needed.

Then you just do:
var mybean = cocoon.getComponent("nameOfBean");


-----Original Message-----
From: Patrick Heiden [] 
Sent: Thursday, June 04, 2009 1:09 PM
Subject: classes in block / usage in flowscript

Hello together,

I am a little bit wondering about following issue.
Assume we have a Java-class inside a cocoon-block (i.e. like the demo
bean out of the tutorial).

When I get a new instance of this class through

var foo = new some.package.inside.block.MyClass();

then i get this error:

Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "some" is
not defined.

There is no Problem to get instances like or the like.

So why is this error thrown when I want to get new Objects out of a
package-hierarchy inside the package-hosting block?

By the way - instantiation via 

var foo = MyClass();

works perfectly well!

Any hints to understand WHY this happens?

Thanks upfront

with best regards,
GMX FreeDSL mit DSL 6.000 Flatrate und Telefonanschluss nur 17,95

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message