default
org.apache.catalina.servlets.DefaultServlet
debug
0
listings
false
1
I copied this verbatim into my web.xml.
Now, I want the default servlet to handle all the accesses to the static resources. I tried to map URLs with certain prefixes to this servlet like so:
default
/js/*
/css/*
/img/*
Not sure what the problem is, but it doesn't work. I'm forced to try extension matching instead:
default
*.gif
*.jpg
*.png
*.js
*.css
*.txt
*.pdf
Well, now that works, but it's not an elegant solution. Imagine, if I want to serve a new kind of file, say an Excel file, I have to remember to include the extension in web.xml, besides just throwing the file into the correct folder. I will have to relook into this again, but for now, I'm just happy it works :)
No comments:
Post a Comment