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: [email protected]
For additional commands, e-mail: [email protected]