91-9990449935 0120-4256464 |
Struts 2 double validation exampleThe double validator checks that given floating-point number is within the specified range. It can be used in product price etc. Parameters of double validatorThere is 5 parameters defined for double validator.
Example of double validatorFull example of double validator1) Create index.jsp for inputThis jsp page creates a form using struts UI tags. It receives name, password and email id from the user. index.jsp2) Create the action classThis action class inherits the ActionSupport class and overrides the execute method. RegisterAction.java3) Create the validation fileHere, we are using bundled validators to perform the validation. Register-validation.xml4) Create struts.xmlThis xml file defines an extra result by the name input, and an interceptor jsonValidatorWorkflowStack. struts.xml5) Create view componentIt is the simple jsp file displaying the information of the user. welcome.jsp
Next TopicStruts2 Url Validation Example
|