The configuration file header for the Struts2 validator today has an error, as follows:
"-//opensymphony group//xwork Validator 1.0.2//en""Http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd" >
The error message is as follows:
Referenced file contains errors (HTTP://WWW.OPENSYMPHONY.COM/XWORK/XWORK-VALIDATOR-1.
Right click Project--Properties--Builders remove JavaScript Validator front tickIf there is no JavaScript validator this item in builders. Then go to the. project file to modify the following:Locate the project directory and delete the following sections in the. project file in the projects directory:and Note that modifying the. project file may require you to restart Eclipse, or close the project in Eclips
Use Hibernate validator to see the above errors, you need to be awareDifference between @NotNull and @NotEmpty and @notblank@NotEmpty used above the collection class@NotBlank used on string@NotNull used on the base typeIf you use Notempty or Notblank on the base type, you'll get the error above.http://blog.csdn.net/dracotianlong/article/details/23181729Javax.validation.UnexpectedTypeException:HV000030:No Validator
Hibernate Validator released, and the new version resolves the following issues:BUG fixesHv-1057-engine-group sequences don ' t honor inheritance relationships properlyHv-1055-engine-default Group sequence does not honour group hierarchyHv-1068-engine-wrong Import in Messagedescriptorformatexceptionhv-1071-engine-hv-1049 prevents annotations in the default package workingHv-1049-engine-don ' t access annotations from the "jdk.internal" packageHv-1054-
consent to the terms of the Privacy Agreement '),//determine if it is a date format Array(' Created ', ' Date ', ' format ' = ' yyyy/mm/dd/hh:mm:ss '),//determines whether the input character is included Array(' Superuser ', ' in ', ' range ' =Array(0, 1)),//the regular validator: Array(' name ', ' match ', ' pattern ' = '/^[a-z0-9\-_]+$/'),//Digital Validator: Array(' id ', ' numerical ', ' mi
When doing web development, it is often necessary to verify the data sent by the client to prevent the data from being illegal. The data check supported by SPRINGMVC is the JSR303 standard, which is verified by annotating the annotation @NotNull @Max on the Bean's properties. JSR303 provides a lot of annotation excuses, and SPRINGMVC for these validations is to use Hibernate implementations, so we need to add a validator package for hibernate:The spri
Official Address: http://bassistance.de/jquery-plugins/jquery-plugin-validation/
Foot home http://www.jb51.net/jiaoben/17478.html
Due to project requirements, it is essential to have a serious date size, but the validation plug-in does not have this function. In this case, we need to extend a custom verification method,
CodeAs follows:
Copy codeThe Code is as follows: $ (document). Ready (function (){
$ ("# $ ("# Aspnetform"). Validate ({
Rules :{
Ctl00 $ contentplaceholder1 $ ucprojinf
Verification of background methods can be implemented in spring interceptor
The configuration file is as follows:
The section is as follows:
Public class exceptionadvice implements throwsadvice, methodbeforeadvice, rule {@ override public void before (method, object [] ARGs, object target) throws throwable {methodvalidator validator = validation. byprovider (hibernatevalidator. class ). configure (). buildvalidatorfactory (). getvalidator (). unwra
-controller
· Address: http://www.cnblogs.com/powertoolsteam/archive/2013/01/11/2855935.html
6. Verify the editing method and view
· Original address: http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/examining-the-edit-methods-and-edit-view
· Address: http://www.cnblogs.com/powertoolsteam/archive/2013/01/24/2874622.html
7. Add new fields to the movie table and Model
· Original address: http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-new-fie
Safe usage of validator in Yii
When I started using yii, I had never understood safe in the validation rules. I tested it today and figured out the meaning of safe. I always thought that safe is the framework that will filter the input content, such as SQL injection and Other filters. Actually, it is not, the main difference between safe and unsafe is that $ model-> attributes = $ _ POST ['user']. This method of value Assignment is called Massive Assi
Common HTML attributes:Data-fv-message="The username is not valid"data-fv-notempty="true"Data-fv-notempty-message="The username is required and cannot was empty"data-fv-regexp="true"data-fv-regexp-regexp="^[a-za-z0-9_\." +$ "data-fv-regexp-message=" The username can only consist of alphabetical, number, dot and underscore "Data-fv-stringlength="true"data-fv-stringlength-min="6"data-fv-stringlength-max= "30"Data-fv-stringlength-message="The username must is more than 6 and less than-characters lo
= "Org.springframework.format.support.FormattingConversionServiceFactoryBean" >Panax Notoginseng - the + A the +And then there's this thing coming up: messages.properties.and the corresponding place in the model layer should also be reflected.1 Public classuser{2 3 @NotEmpty4 PrivateString username;5 @NotEmpty6 PrivateString password;7 @NotEmpty8 PrivateString Repassword;9 Ten @NotEmpty One @Email A PrivateString Email; - @NotEmpty - PrivateString XM; the}The last one
Official Address: http://bassistance.de/jquery-plugins/jquery-plugin-validation/Foot home http://www.jb51.net/jiaoben/17478.htmlDue to project requirements, it is essential to have a serious date size, but the Validation plug-in does not have this function. In this case, we need to extend a custom verification method. The Code is as follows:Copy codeThe Code is as follows:$ (Document). ready (function (){$ ("# $ ("# AspnetForm"). validate ({Rules :{Ctl00 $ ContentPlaceHolder1 $ ucProjInfo1 $ ucD
To verify the input format and to verify the number of keywords by validate custom validation$.validator.addmethod ("Stringcheck",function(value, Element) {varPattern =/^ (?!,) ([a-za-z0-9\u4e00-\u9fa5]+[,]?) +[a-za-z0-9\u4e00-\u9fa5]+$/; if(!pattern.test (value)) {$ (Element). Data (' Error-msg ', ' format is wrong! ‘); return false; } varnum = (value.split (', ')). length; if(Num > 5) {$ (Element). Data (' Error-msg ', ' up to five keywords! ‘); return false; } re
If you are adding an interface, the validation rules generallyQuery SQL is like thisBecause of the definition of a separate validation class, if you want to add some variables in the manual, what do you do??? (Not enough to see other uses to validate the introduction of external variables in a standalone class)Rules like this, normal in the editing interface validation, the submission of their own data will often prompt repetition,No solution has been found before and no suitable solution is fou
be declared before a method parameter.Elementtype.constructor: Note that the annotation can only be declared before the constructor of a class.Elementtype.local_variable: Note that the note can only be declared before a local variable.Elementtype.annotation_type: Note that the note can only be declared before an annotation type.Elementtype.package: Note that the note can only be declared before a package name.@Constraint to limit the way custom annotations are definedThe class that is written h
Old Wei original, reproduced please leave a message. Cause: Annotations To fields in JavaBean are superfluous or error-induced.@NotEmpty @past@datetimeformat (pattern= "YYYY-MM-DD") public Date Employeebirth;The above is an error case. @notempty annotations should be removed. Because the object of this annotation does not include a field of the time type."Springmvc" data check, throw Javax.validation.UnexpectedTypeException:HV000030:No validator could
general, such operations are done by the program,
$ ("Input[name= ' productId ']"). Val (Data.productid);
Bootstrapvalidator This plugin cannot capture such "program assignment events", so there is no validation effect here, so we need to make a little workaround:
$ ("#addForm"). Bootstrapvalidator ({
//excluded:[": Hidden", ":d isabled", ": Not (visible)"],// Bootstrapvalidator's default configuration
excluded:[":d isabled"],//critical configuration, which means that only
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.