RSS

Using ‘resources’ path in Wicket Causes Problems Loading CSS, Images and JavaScript

Sat, Aug 9, 2008    (Rating: 4 stars, Click to rate this article!) Loading ... Loading ...

Software Development


Bah… 3 hours worth of debugging and finally figured out what was going on with this issue in Wicket and wnated to share this with any other developers out there that might be running into this.

Issue

I typically create a /resources directory under the root of any web app I’m working on where I places CSS, JavaScript and Images. Unfortunately it seems that in Wicket (a great framework BTW) the word “resources” is reserved… or special… or something.

Basically every time I tried to reference my CSS from my HTML using:

<link rel="stylesheet" type="text/css" href="resource/css/main.css" />

My app would startup, I would see in the log files the last line something along the lines of “Unable to find resource: main.css” and my CSS would never apply.

I was looking into header contributors and a whole myriad of other things I thought might be the issue.

Solution

I finally found this link with a message from Igor that made me think “hmm… maybe the ‘resources’ name is special?” so I changed my path to /resource (singular) and walla, CSS works fine now with all the exact same code I had.

Hopefully this tip saves someone else some time too.

Share This on Your Favorite Social Network:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • Propeller
  • Reddit
  • Technorati
  • StumbleUpon
  • description
  • MisterWong
  • TwitThis
  • Slashdot
  • SphereIt
, , ,

This post was written by:

Riyad Kalla - who has written 18 posts on kallasoft.

Riyad has participated in the software industry in Open Source, research and commercial software design and development both professionally and as a hobby. Riyad leads the Product Services team for a industry leading tech company out of Dallas, writes software in his spare time and most importantly hopes the information here helps developers out there.

Leave a Reply