File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Ant, Maven and Other Build Tools and the fly likes Maven html checker Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Maven html checker" Watch "Maven html checker" New topic

Maven html checker

Adrien Ruffie
Ranch Hand

Joined: Jan 14, 2009
Posts: 92
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

Joined: Jun 25, 2001
Posts: 17410

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.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Maven html checker
It's not a secret anymore!