Remember this old JSP stuff for webpages? Still exists!
Warning: Nerd Content!
Remember this ancient technology called Java JSP, where Java Code is mixed into HTML pages? Memories of the times where refactoring was a pain, and our favorite exception was „NoSuchMethodError“ because of spelling mistakes.
Well this technology still exists and although most Google found content is from 2000 to 2003, one comes across these projects. I just recently found a very nice way to precompile and thus check all JSP pages for valid Java at Dev time, not on user time.
Here it is. You can use the ServletContext to find all JSPs and then init the precomile of all pages without actually browsing to the page.
Why like this? Well mostly, that is an easy way, because calling the precompile itself is a JSP (perfect for Selenium IDE testing) and secondly because it works in current tomcat 7. All other approaches like the ANT „jspc“ task are not supported since tomcat 5 anymore and fixing the related bugs involves even a custom build of your tomcat. Thank you to the idea as of javapapers.com.