Verification Framework-based input verification
1. Create a struts2 project testValidators. Struts2 Initial Experience: http://www.cnblogs.com/likailan/p/3280820.html
Registration page, register. jsp:
Use
Use the
Registered Email: Password: Repeated password: Phone:
Registered successfully
The fields to be verified must provide the corresponding fields and the corresponding get and set methods in the class.
RegisterAction String execute()
The following is the js Code (it is not elegant when binding objects. I hope you can give me some advice !)Copy codeThe Code is as follows:Function validator (obj, option) {// verification objectVar self = this;If (! (Self instanceof validator ))Return new validator (obj, option );Self. source = {'mobile': '^ (13 | 14 | 15 | 18) [0-9] {9} $', 'postcode ': '^ \ d
? The answer is in the negative. Take your resume as an example, you need to create a separate format file that describes how each tag is displayed, as follows (assuming the file name is Resume.css):
resume{Display:block;}
name{display:block; font-size:120%;}
sex{display:block; Text-indent:2em}
birthday{display:block; Text-indent:2em}
skill{display:block; Text-indent:2em}
Description
All of the above are CSS style, we recommend that readers refer to the relevant
The structure of the validation. xml file is defined by the validator_1_1_3.dtd file. The content of the file header is as follows:
"-// Apache Software Foundation // DTD commons validator rules configuration 1.1.3 // en"
Http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd>
The top-level element is
..............
The attributes are described as follows:
L name: indicates that the form name is the s
Examples of using the zf framework validator. This article describes how to use the zf framework validator (custom validator and validator chain). If you need it, refer to the following code :? Phprequire_once (ZendLoader. php); this article mainly introduces the use example of the zf framework
Here is a list of 5 free online CSS validator sites. These sites allow you to validate your CSS code freely without any hassle. You can choose to upload the file, verify the CSS add URL, or simply copy and paste the full CSS code. The good point is that these sites not only point out the errors in the code, but they also recommend methods that can be resolved.All of these sites are useful for learners as well as CSS code encoders for seasonal CSS. Ver
not new, but generating xml is fresh. Here we will introduce the specific generation steps.
Using xsl as the template languageXsl (extensible style sheet language) is a good way to define the xml data display format. it is more effective if you write several static templates.
Generate htmlAdding xsl to xml is equivalent to html. This sounds wrong, but what we see in the user's html page is actually the res
Basic Tutorials
XSL IntroductionXML Stylesheet Language XSL is much more complex than CCS.Css:html Style Sheet languageBecause HTML uses predefined tags, the meanings of these tags are well understood:Using CSS to add a display format to HTML elements is a simple process: it's easy to tell the browser to display the elements in a particular font or color, and the browser is easy to understand.Xsl:xml's sty
the onsubmit method and the dosubmitaction method are analyzed.
It explains how to integrate the validator framework into the design idea of spring:Class myvalidator implements validator{Boolean supports (class clazz){Why can't I use: usercommand. Class. Equals (clazz );?This is mainly because the class does not overwrite the equals method.}
Void validate (Object OBJ, errors){}}The written verification met
In struts, validator is very useful. It can help users get away from tedious page verification work and put the page verification work in the configuration file, struts has the following built-in validators that we often use:
· The validatebyte check value can be safely converted to byte· Validatecreditcard is a valid credit card number.· The validatedate check value is a valid date.· Validatedouble check value can be safely converted to double· The v
XSL is for XML, just like CSS for HTML. EXtensibleStylesheetLanguage ). This is a language used to display XML data in a readable format. XSL actually contains two parts: * the language in which XSLT is used to convert XML documents
XSL is for XML, just like CSS for HTML. It refers to EXtensible Stylesheet Language ). This is a language used to display XML data i
XSL Study Notes (1)
Some people say that XSL is the replacement of CSS. Is it true?
1. IntroductionXSL is a language that describes style sheets, including XSLT, XPath, and XML format objects.Unlike HTML, XML does not have predefined labels, so Browsers Do not know how to display XML documents, while XSL is used outside XML to show how to display.
2. XSLT
It programmer development Essentials-all kinds of resources download list, history of the most IT resources, personal collection summary. These system validators are defined in the Default.xml under Com.opensymphony.xwork2.validator.validators in Xwork-2.x.jar:
the system provides the following validator:Required(Required validator, required field value cannot be null)requiredstring(A required String validator
This is the login form model
class LoginForm extends Model{ public $account; public $password; /** * @return array the validation rules. */ public function rules() { return [ ['account','app\components\NameValidator','maxLen'=>12] ]; }}
App\components\namevalidator is a validator that I have customized:
namespace App\components;use Yii\validators\validator
In the business logic in the background, the checksum of the data value exists in each layer (presentation layer, business layer, data access layer, etc.), and the rules of each layer check are different, as shown inNote: This image is from Hibernate Validator official websiteThe repeated checksum logic in each layer leads to unnecessary resource consumption and makes logic less than single (each layer is mixed with a checksum logic), and the JSR 303
XSL concise tutorial (II)
5. XSL Index
Chapter Guide
If I want to arrange the display of elements in a certain order, how should I create an XSL index?
Let's take a look at the previous example, or this Code:
.
.
.
When an XML document is converted to an HTML file, the index should be created at the same time. The simple method is to add an order-by
xml| Dynamic | page XML (Extensible Markup Language) it might look like some sort of a world standard--there's no real impact right now, even if it comes in handy later. But in fact, it has now been applied. So don't wait until the XML has been added to your favorite HTML editor to start using it. It can now solve a variety of internal problems and business-to-business systems issues.
In sparks.com, we use XML to standardize data representations between different systems, from Java objects to H
This article mainly introduces the method of using Async-validator to write Form components, small series feel very good, and now share to everyone, but also for everyone to do a reference. Follow the small series together to see it, hope to help everyone.
In front-end development, the validation of forms is a very common feature, and some UI libraries such as ant.design and element UI implement a form component that has a checksum capability. Async
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)
II: Modify/reload the
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service