Transform & Execute Apache Struts 1.x based validations to Bean Validation through JSF

  IJCTT-book-cover
 
International Journal of Computer Trends and Technology (IJCTT)          
 
© 2019 by IJCTT Journal
Volume-67 Issue-4
Year of Publication : 2019
Authors : Vijay Kumar Pandey
DOI :  10.14445/22312803/IJCTT-V67I4P105

MLA

MLA Style: Vijay Kumar Pandey "Transform & Execute Apache Struts 1.x based validations to Bean Validation through JSF" International Journal of Computer Trends and Technology 67.4 (2019): 24-28.

APA Style:Vijay Kumar Pandey (2019). Transform & Execute Apache Struts 1.x based validations to Bean Validation through JSF. International Journal of Computer Trends and Technology, 67(4), 24-28.

Abstract
The paperis intended to provide an understanding of how to transform and execute Apache Struts 1.x based validation to Bean Validation and then execute the transformed validate method through Java Server Faces (JSF) runtime. JSF by default executes the validation PROCESS_VALIDATIONS after the APPLY_REQUEST_VALUES phase and if there are no validation issues then the control passes to UPDATE_MODEL_VALUES phase else it goes to the RENDER_RESPONSE phase. While in the Struts 1.x application, first the Struts action form is populated with the request parameter values and then only it’s ‘validate’ method is executed. So direct mapping of struts validation execution process will fail in JSF since model (action form) will not be populated with the request parameterswhen the validation is executed.

Reference
[1] Apache Commons Validator - https://commons.apache.org/proper/commons-validator/
[2] OmniFaces - http://omnifaces.org/
[3] Bean Validation 2.0 JSR 380- https://beanvalidation.org/2.0/
[4] Java Server Faces - https://javaee.github.io/javaserverfaces-spec/
[5] Struts Validation in ActionForm - https://www.owasp.org/index.php/Struts_Validation_in_an_ActionForm

Keywords
Struts, JSF, ‘’validate’ method,Bean Validation (BV), OmniFaces, ThreadLocal, ActionForm, ControllerBean, TagHandler.