Hi,

I have the following code in my base page:

public void renderHead(IHeaderResponse response) {
    // scripts/jquery-1.7.1.min.js is in webapp dir
    response.renderJavaScriptReference("scripts/jquery-1.7.1.min.js");
}

How can I transform this direct URL to a ResourceReference?

PackageResourceReference is not a good fit because I don't want to store the .js in a Java package since it is used by non-wicket pages.

With ContextRelativeResource, Wicket reads the actual resource and sends the result instead of simply pointing to a URL.

AbstractResource with its newResourceResponse() abstract method requires to return the actual ResourceResponse which won't allow for a simple URL.

So from what I gather, I would have to fallback to implementing an IResource's respond(Attributes attributes) method. I looked at the implementation in AbstractResource but I'm confused about what to do with headers since I only want a URL.

So, does this functionality already exist? If not, do you have a few pointers to steer me in the right direction?

Thanks,
Bertrand

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to