Every repository with this icon (
Every repository with this icon (
tree 1cf9bd6008c825360f167d764d8946e44cac3070
parent b3c77189a821a5b0340e80c32909087e41f6e8e1
| name | age | message | |
|---|---|---|---|
| |
LICENSE.txt | Tue Feb 17 12:33:45 -0800 2009 | |
| |
README.markdown | Tue Jun 09 02:15:38 -0700 2009 | |
| |
pom.xml | Tue Jun 09 02:16:26 -0700 2009 | |
| |
src/ | Tue Jun 09 02:14:24 -0700 2009 |
Wicket Stuff HTML Validator
This validator filter is based upon the work of the validator filter created by the Tuckey developers. This validator only validates XHTML based on the XHTML DTDs. This package is licensed under the Gnu Public License.
We have provided the HTML Validator with extra settings to ignore non-DTD, but generally useful and accepted practises, such as the "autocomplete=false" attribute for text fields. We also added the ability to ignore a couple of Wicket encoding bugs where & characters were not converted to proper entities.
Usage
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>
Building
This project requires Apache Maven (>= 2.0.9) to be built. Just perform a mvn install and include the following in your project's pom:
<dependency>
<groupId>org.wicketstuff</groupId>
<artifactId>htmlvalidator</artifactId>
<version>1.2</version>
<scope>test</scope>
</dependency>
If you wish to deploy the markup filter, you should change the scope to compile.
Examples
For examples, start the embedded Jetty server found in src/test/java







