[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xml-cocoon-users
Subject:    RE: Cocoon.load
From:       "Robby Pelssers" <robby.pelssers () ciber ! com>
Date:       2010-02-18 10:04:19
Message-ID: 7C655C04B6F59643A1EF66056C0E095E0372F41F () eusex01 ! sweden ! ecsoft
[Download RAW message or body]

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.Schmitz@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.chicchiricco@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-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic