Rahul Garg Rahul Garg - 4 years ago 129
Java Question

How to access static resources when mapping a global front controller servlet on /*

I've mapped the Spring MVC dispatcher as a global front controller servlet on



However, this mapping stops the access to static files like CSS, JS, images etc which are all in the

How can I access them anyway?

Answer Source

I've run into this also and never found a great solution. I ended up mapping my servlet one level higher in the URL hierarchy:


And now everything at the base context (and in your /res directory) can be served up by your container.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download