views:

78

answers:

2

Is there any tool to do for JSP files what checkstyle does for Java files? The ideal would be to include JSP checking on checkstyle, but as far as I can see, this isn't possible.

I would like for example to check JSP files for :

  • Indentation style
  • Right placements of certain constructs
  • Tab / space check
  • Check for use of scriplets

Thanks Emerson

+1  A: 

Yes, there is something similar (but not for exactly those checks): You can use IntelliJ IDEA's "Inspection" functionality to inspect JSPs for various problems, and those inspections can be run from the command line too (use inspect.bat in IntelliJ's /bin directory).

For this you will need to create a "profile" to include only the desired JSP inspections, test it from the IDE (Analyze/Inspect Code), and if they're OK, run them from the command line too (and e.g. call them from your build tool).

Based on those existing JSP inspections, than you could write other inspections too (but this require a little more skill since there's no good documentation for this - just the source code of IntelliJ plug-ins and the support forums)

A. Ionescu
We have still a few developers that use IntelliJ, but we are trying to leave the dependency on IntelliJ, so this solution really don't help us much. Thanks anyway.
Emerson
If you still have developers using IntelliJ than also have licenses, so it's enough to put one license + instance of it on your Continuous Integration server to do those checks in batch mode for the entire team. Also, a "tool" is just a "tool" not really a "dependency" :).
Adrian A.
Thanks for the tip. But it would be great if checkstyle was expanded to add JSP checking...
Emerson
+1  A: 

Check this Eclipse PlugIn: http://www.myeclipseide.com/htmlpages-func-display-pid-11.html

O.Daka