cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francesco Chicchiriccò <>
Subject Re: Cocoon.load
Date Tue, 16 Feb 2010 09:28:46 GMT
On 15/feb/10, at 19:30, Schmitz, Jeffrey A wrote:

> Hello,
>   I'm running my cocoon app under tomcat, and am trying to figure  
> out where to place the target of a cocoon.load call in my flowscript  
> so that it will be found at runtime.
> For example, I'm trying to use:
> cocoon.load("resource://org/apache/cocoon/forms/flow/javascript/ 
> Form.js");
> While I've gotten this to work under the included jetty server, I'm  
> not sure how to transfer this over so it will work correctly as a  
> tomcat webapp.  Any help would be greatly appreciated.

if you use the resource:// protocol to find your JS, this means that  
the JS file is usually located inside a JAR file, under the specified  
package. The JAR file must of course be in the classpath of your web  
application, usually under WEB-INF/lib folder.

If you want instead to refer to a JS file not in any JAR, you should  
consider the path from the folder in which the sitemap including the  
referring JS is located.

For example:


if sitemap.xmap loads "flow/main.js", you can include external.js by  


inside main.js.

Note that what I wrote above only derives from my personal experience,  
so it is very likely that the underlying theory about loaders is far  
much involved than this. Nevertheless, this is working ;-)


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

View raw message