For the latest download, visit http://ww2validator.dev.java.net
Webwork2 extended validator instructions
1. Download and decompress the file
2. Find jscud_wwvalidators_1 _??. Jar, modify the classpath or copy it to the corresponding path
3. Copy the checkform. js file to your project and then reference
There are two methods to reference
I: Reference checkform. js directly in your program (note that you need to modify the path)
<Script language = "JavaScript" src = "checkform. js"> </SCRIPT>
II: Modify/reload the form-close.vm, reference or include checkform. js. See the webwork documentation.
For example, add: # parse ("/template/XXX/checkform. js ")
Or
<Script language = "JavaScript" src = "$ Req. contextpath/JS/checkform. js"> </SCRIPT>
# Parse ("/template/simple/form. VM ")
<Table class = "wwformtable">
4. Modify Your validators. xml
NOTE: For the multi-language String Length checker, you can only use one of them for one project. It can be set based on your storage situation. You can also set it during installation. (This is inconvenient, but there may be no choice)
See validators in the test directory.
5. Modify the validation file XXXAction-validation.xml or XXXAction-Alias-validation.xml
Refer to the TestAction-doAdd-validation.xml under the test directory
Validator list
Server Side validator |
Client JavaScript validator |
Desc |
Parameter |
Memo |
Requiredstringvalidator |
Jsrequiredstringvalidator |
Required string validator |
|
Javascript deal trim |
Stringlengthfieldvalidator |
Jsstringlengthfieldvalidator |
String Length validator |
|
|
Integervalidator |
Jsintegervalidator |
Int validaotr |
|
Javascript check validity |
Floatvalidator |
Jsfloatvalidator |
Float validator |
|
|
Longvalidator |
- |
Long validator |
|
|
Emailvalidator |
Jsemailvalidator |
Email validator |
- |
Javascript change |
Urlvalidator |
Jsurlvalidator |
URL validator |
- |
|
Abclettervalidator |
Jsabclettervalidator |
26 letters validator |
- |
|
Basewordvalidator |
Jsbasewordvalidator |
Base ASCII letter validator |
- |
|
Customdataregexpvalidator |
Jscustomdataregexpvalidator |
Custom Reg express validator |
Regexp |
|
|
|
|
|
|
|
|
|
|
|
String storage length validator |
One2onesavestringlengthfieldvalidator |
Jsone2onesavestringlengthfieldvalidator |
One-> one |
|
|
One2twosavestringlengthfieldvalidator |
Jsone2twosavestringlengthfieldvalidator |
One-> two |
|
|
One2threesavestringlengthfieldvalidator |
Jsone2threesavestringlengthfieldvalidator |
One-> three |
|
|
|
|
|
|
|
Blue class: webwork class, not belong This Lib.
Red class: webwork exist same class, this lib improve it or change it.