In fact, this is not working too.
I think it because wicket couldn't find my javascript file.
when I give url (this file can be accessed via url also) it's working, but not 
with a filesystem path
and I really need not to pass by filesytem...

On Jul 15, 2010, at 6:06 PM, Martin Makundi wrote:

This is easier:

   response.renderJavascriptReference("/js/jquery.js");


**
Martin

2010/7/15 Jarosz Yohan <[email protected]<mailto:[email protected]>>:
Hello,

I'm trying to load statatic js files. I 'm using in the init of the application

getResourceSettings().addResourceFolder("/somePath/");
resourceSettings.setResourceStreamLocator(new RessourceLocator());

with
public class RessourceLocator extends ResourceStreamLocator{
public RessourceLocator() {}
public IResourceStream locate(final Class<?> clazz, final String path) {
       IResourceStream located = super.locate(clazz, trimFolders(path));
       if (located != null) {return located;}
       return super.locate(clazz, path);
}
   private String trimFolders(String path) {
       return path.substring(path.lastIndexOf("/") + 1);}
}

and in my Page I have
add(JavascriptPackageResource.getHeaderContribution("/myFile.js"));
and of course myFile.js located under /somePath"

what am I missing?

Yohan



---------------------------------------------------------------------
To unsubscribe, e-mail: 
[email protected]<mailto:[email protected]>
For additional commands, e-mail: 
[email protected]<mailto:[email protected]>


Jarosz Yohan
Bioinformatics & Biostatistics Core Facility
EPFL School of Life Sciences

   EPFL SV PTECH PTBB
   AAB 0 23
   Station 15
   1015 Lausanne
   Switzerland

phone: [+41 21 69] 31439
email:   [email protected]<mailto:[email protected]>



Reply via email to