It's not clear to me if you use cocoon2.2 but otherwise you can use following snippet:
cocoon.load("servlet:forms:/resource/internal/flow/javascript/Form.js"); Kind regards, Robby Pelssers -----Original Message----- From: Schmitz, Jeffrey A [mailto:jeffrey.a.schm...@boeing.com] Sent: Tuesday, February 16, 2010 5:09 PM To: users@cocoon.apache.org Subject: RE: Cocoon.load Thanks, I do have the cocoon-forms-block.jar in my lib folder, but it still can't seem to find it. And actually, I have all the same jar files that are in the jetty WEB-INF lib in my tomcat webapp lib too. I also tried moving the js file to the same folder as the sitemap and changing the reference to just cocoon.load("Form.js"); And still no luck. Also, is there somewhere that describes what all the prefixes mean for the cocoon.load call? Jeff > -----Original Message----- > From: Francesco Chicchiriccò > [mailto:francesco.chicchiri...@everett.it] > Sent: Tuesday, February 16, 2010 3:29 AM > To: users@cocoon.apache.org > Subject: Re: Cocoon.load > > 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. > > Hi, > 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: > > A/ > sitemap.xmap > flow/ > main.js > external.js > > if sitemap.xmap loads "flow/main.js", you can include > external.js by putting > > cocoon.load("flow/external.js"); > > 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 ;-) > > Cheers. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org > For additional commands, e-mail: users-h...@cocoon.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org