One of the most puzzling things about web development is when something works in one browser, but doesn’t in another. Often this is the case when your document is not standards compliant. For example you declare that your markup is XHTML strict, but have a structural problem in your markup. Browsers will try to repair your document, but can take different measures to cope with the problem.
The way to avoid such differences is to ensure that at least your documents are up to spec. Running your website manually through the W3C validator is not an option. So I set out to make this a less painful exercise. Searching the internets provided me with the Tuckey ValidationFilter, but integrating it with our application was not really working, because of some CSS issues (z-index, fonts, alignment, coloring). Long story short, I’d figure taking up the ValidationFilter and integrating it someway into a little bit more Wicket like fashion. I’ve implemented it as a IResponseFilter and have it insert the necessary markup into the response at the end of the head and body sections when the original markup was invalid.
When you enable the HtmlValidatorResponseFilter in your project, you see your markup mistakes immediately when developing your application. No longer is standards compliant markup an afterthought, but directly visible the moment you fire up your local server and browser.
The htmlvalidator project contains an example application with valid and invalid markup. You can run it by starting the embedded Jetty server using the Start class in the src/test/java folder and pointing your browser to localhost:8080.
The project is available on my github space. The project needs to be build using Maven, but that shouldn’t hold you back trying it out. It mostly builds upon the code from the Tuckey guys, so major thanks go to them. I’m hoping to find an Apache License compatible, up to date, markup validator so we can ship this functionality out of the box with Wicket 1.5.
Things I’d like to improve:
ApacheCon EU hosts 2 days worth of Wicket training March 23rd and 24th in Amsterdam: Introduction to Wicket and Behavior Driven Development with Wicket and JDave. These trainings will be given by core team members of the Apache Wicket project, giving you access to the experts.
You can pick and choose, but if you want the best experience you should book both courses. On monday I’ll be giving an introduction course to Apache Wicket. On tuesday, Timo Rantalaiho will give a course on driving your web application development using Wicket, WebDriver and JDave.
March 23rd, Martijn Dashorst, full description
Learn how to use Apache Wicket to create web applications on your own from the masters. This hands-on lab will provide a quick introduction to the Wicket framework and we’ll start with coding right away. At the basis for this course lies the Wicket in Action book, written by the course leader. We’ll start with setting up our project, move on from a simple hello world application to implementing an online cheese store. We’ll learn to connect it to services delivered by Spring and a back end served with a JPA provider (Hibernate or OpenJPA). During this course we’ll cover the end-to-end basics of web application development: unit testing, writing maintainable code, internationalization, security and deployment.
March 24th, Timo Rantalaiho, full description
How to get good unit and black-box test coverage by expressive, executable specifications on your Apache Wicket application code, with JDave BDD framework and WebDriver functional testing tool.The training is mostly hands-on programming assignments of applying WebDriver and jdave-wicket for testing and adding features to a Wicket application.
With this book, Wicket will become the greatest territory the Dutch have settled since Manhattan.
Senior Software Engineer, Teachscape Inc.
This is the complete and authoritative guide to Wicket, written and reviewed by the core members of the Apache Wicket team. If there's anything you want to know about Wicket, you are sure to find it in this book.
Founder and Architect of Apache Wicket, Foreword Wicket in Action
Without question, Wicket in Action... is the be-all and end-all when it comes to Wicket.
Geertjan Wielenga, Wicket Netbeans Plugin Author
The tutorial and conversational tone of the writing makes the book very approachable.
Loved the sample application—it tied everything together.
Senior Software Developer, SAS Institute
The essential guide for learning and using Wicket.
Erik van Oosten
Lead programmer and Project Manager, JTeam
Finally, the Web Framework of web frameworks, Apache Wicket, now has a bible of its own.
Senior Software Architect, Heimore group
Wicket is an innovative evolution of the MVC programming with simple roots, but without a primer such as this, it can be more challenging than it needs to be.
Founder, Bill2 Inc.
Wicket In Action glues the areas of web development with Apache Wicket together and gives a great overview of Apache Wicket...it will make a great compendium.
Nino Martinez Wael
Java Specialist, Jayway Denmark