I just performed the 1.2 release of WicketStuff HTML Validator, thanks to Emond Papegaaij, a Topicus Onderwijs co-worker. This new release adds the ability to ignore Wicket specific bugs when using the & entity in JavaScript calls, and adds the ability to ignore <input type=”text” autocomplete=”false” /> validation errors. Even though you specify that your document is (X)HTML compliant, browsers will (fortunately) still work with these validation errors present.
The markup validator was featured in my presentation “Get your Wicket Application in production (and keep your weekends free)”. The validator will notify you if you have invalid HTML markup in your rendered pages. While usually not destructive, having invalid markup can result in long debugging errors when replacing part of your page with for example Ajax, or traversing the DOM.
You can use it by adding the HtmlValidationResponseFilter to the Wicket
request cycle filters in the following fashion:
public class MyApplication extends WebApplication { // ... @Override protected void init() { // only enable the markup filter in DEVELOPMENT mode if(DEVELOPMENT.equals(getConfigurationType())) { HtmlValidationResponseFilter htmlvalidator = new HtmlValidationResponseFilter(); htmlvalidator.setIgnoreAutocomplete(true); htmlvalidator.setIgnoreKnownWicketBugs(true); getRequestCycleSettings() .addResponseFilter(htmlvalidator); } } }
And you’re all set. Make sure you define a XHTML doctype in your pages, such
as:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Foo</title>
</head>
<body>
</body>
</html>To use the HtmlValidator, include the following in your project’s pom:
<dependency> <groupId>org.wicketstuff</groupId> <artifactId>htmlvalidator</artifactId> <version>1.2</version> <scope>test</scope> </dependency>
You might need to add the Wicket Stuff maven repository to your repository list.
[...] during development and not production, I find this tool very useful. For more informations visit author’s blog or tools [...]
Pingback by Wicket HTML validator « Paul Szulc’s Blog — July 30, 2009 @ 11:55 am
Very nice, I’ve put info on my blog to spread the word
Comment by Paul Szulc — July 30, 2009 @ 11:57 am
Hello,
I have modified the Wicket-Bench plugin to satisfy my needs, I tested the plugin on Eclipse 3.5, 3.4, 3.3.
I think the plugin may help others also. How can I share It.
Functionality I added:
1. A place to provide “Context Path” In the New Project Wizard.
2. Added latest Wicket 1.4.3 jar to the project.
3. Added Jetty Support
4. Added a class named “RunProject” to run the project using Jetty
5. Added “build/build.xml” to create a war that can be deployed On Apache Tomcat.
Removed few Bugs.
I have no Idea about version control, so please forgive me.
Alok Pathak
Comment by Alok Pathak — November 9, 2009 @ 12:01 pm