create a CssResource and JavascriptResource that extend Resource and know how to stream the contents by reading parameters off url. add those to application.getsharedresources().
then call urlfor(resourcereference) and you should have the url that invoke the resource. resourceref should have the same class,string you used to register the resource with shared resources. so you will end up with <link type="text/css" href="resources/com.my.component/javascript.js?foo=bar"/> in your html -igor On Wed, Feb 27, 2008 at 10:12 AM, spencer.c <[EMAIL PROTECTED]> wrote: > > I am making a component which needs to add (1) some javascript which > references the location of some images, and (2) some style-sheet information > which references some images. The images are going to be located in the jar > that contains the component. > > Since I need to insert the location of the images into the .js and .css, I > templated them using PackagedTextTemplate, to insert the appropriate > references at runtime. > > Now, rather than insert the style info and javascript directly into the page > I was trying to make those dynamic resources, so that they get generated > once and then are easily referenced, rather than being re-templatized with > each component request. I made two classes that override WebResource to > provide the correct content. My question is, how do I let my component jar > register these resources and then how do I include the references in the > component itself? I think this is probably straightforward, but haven't > been able to find an example of this somewhere. > Thanks for any pointers. > -- > View this message in context: > http://www.nabble.com/First-Complex-Component-Question...-tp15719359p15719359.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
