I use several JavaScript libraries in my web apps. Just one of the many reasons I like Spring MVC over other web frameworks – like JSF – is that you can easily use current web technologies. HTML5? CSS3? jQuery? No problem!
Actually there is one problem, but it’s an Eclipse (or Spring STS) problem. When you add JavaScript to your project, Eclipse will validate the code. This is what I want when I am developing code! But I don’t want to debug or modify third party code. The Eclipse validator will almost always complain about minified versions of JavaScript files.

You can turn off validation. Problem solved. You can also remove squirrels from your backyard bird feeders with a bazooka.
A better solution
- Open the project’s properties dialog. (right click, properties or Command-I)
- Select JavaScript then Include Path from the tree on the left.
- Select the Source tab in the property sheet.
- Select the Excluded node from the project tree.
- Press the Edit button.
- In the modal dialog that pops up, add an Exclusion Pattern.
I put third party JavaScript in src/main/webapp/resources/js/libs and my own JavaScript in src/main/webapp/resources/js. So I add only src/main/webapp/resources/js/libs as an exclusion pattern. Then I no longer see jQuery, modernizr, or bootstrap errors, but I do see JavaScript errors in the code that I’m developing.
