• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Maven html checker

 
Adrien Ruffie
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

I search a maven plugin, or other tools which allow to check a html code of jsp page.

For example, I have 5 jsp pages in my project and I need to run a Maven plugin, task, ...
which check the correct syntax of html of my jsp pages and break the build if an error
is found.

I have found jspc of tomcat bug, it doesn't check html code, only java code ...

Do you know a tools which allow this ?

best regards
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18226
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HTML is inordinately difficult to check, since the HTML standard is not as rigorous as XML, and on top of that, no few frameworks compound the issue by attaching new tags and attributes to stock HTML - taking advantage of the rule that says that anything an HTML client cannot understand it should silently ignore.

If you have JSP and HTML code in the same file, the job becomes virtually impossible, since not only does the analyzer have to flip-flop between 2 radically different "languages", the JSP code can be emitting HTML internally. The IDE-based editors make a valiant attempt at it, but often have slow performance and/or bugs.

For best results, use xhtml instead of basic HTML, and don't mix in JSP code.

As for actual checkers, I often use HTML-tidy, which is available as an IDE plug-in. If there isn't a Maven mojo for tidy, I think it would probably be easy to create one.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic