Web
Finally, I intend to analyze the input in the webwork2.x section, the school inspection data usually includes client inspection and service-side check two, in the webwork2.x have very good support, first of all to analyze the service side, the service side of the school check class are all from the Com.opensymphony.xwork.validat or package, the service side of all the school inspection work is through a validationinterceptor interceptor to intercept, so that interceptor in the webwork2.x position is equivalent to our hearts "God", he is used to save everything, a bit exaggerated, Ha ha!
Below please enjoy the code of the Validationinterceptor interceptor
public class Validationinterceptor extends Aroundinterceptor {
protected void after (Actioninvocation dispatcher, String result) throws Exception {
}
Get the action, and then call Actionvalidatormanager to do the checking work
protected void before (Actioninvocation invocation) throws Exception {
Call the school check class and note that all custom check classes must be implemented from the validator interface
Validator.validate (object);
}
...
}
As for the client check, because the operation is all from the Com.opensymphony.webwork.validators package, all other school inspection classes are inherited from the Scriptvalidationaware interface, due to the relationship between time I do not do analysis here, If you are interested, go and study it yourself!
In fact, there are a lot of webwork2.x inside the details of the call, I can not describe this, if you are interested, you may wish to look at the source.
Today is here, ah, as for the webwork2.x label I do not want to see, I do not know what is the reason I just do not like the label Ah, the next Java Web application I must use webwork2.x to develop, such a good framework does not have to be too bad ah!
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.