wood burning stoves*
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
Author

Maven html checker

Adrien Ruffie
Ranch Hand

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


SCJP 5, SCDJWS 5
http://adrien-ruffie.blogspot.com
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15956
    
  19

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Maven html checker
 
Similar Threads
Eclipse: jaxws-maven-plugin:2.2:wsimport error
JSP validation free tool
maven with checkstyle configuration
Eclipse: jaxws-maven-plugin:2.2:wsimport error
Maven 1 to Maven 2 upgrade