I’m working on making a reusable component that is styled with a CSS file that references some images.  I’ve been looking for a solution to this, and I think it’s just that I’m having a disconnect in dealing with Resources.  Here’s a simple version of what I’m trying to do:


Component.jar contains:









.myclass1 {

            Background: url(MyImage2.jpg); // What do I put here?


.myclass2 {

            Background: url(MyImage2.jpg); // What do I put here?



How do I code the rest of my component to get this to work?  I’ve gotten it to read the .css file by doing:


        getApplication().getSharedResources().putClassAlias(getClass(), "mycomponent");

        add(HeaderContributor.forCss(getClass(), "MyComponent.css"));


And that puts a nice entry in the header that works like:


<link rel="stylesheet" type="text/css" href="/test/app/resources/mycomponent/MyComponent.css"></link>


I’m lost as to how to get my images to read correctly.

Thanks for any help with this, and thanks for a very nice framework!



Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
Wicket-user mailing list

Reply via email to