International Journal of Computer
Trends and Technology

Research Article | Open Access | Download PDF

Volume 67 | Issue 4 | Year 2019 | Article Id. IJCTT-V67I4P105 | DOI : https://doi.org/10.14445/22312803/IJCTT-V67I4P105

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


Vijay Kumar Pande

Citation :

Vijay Kumar Pande, "Transform & Execute Apache Struts 1.x based validations to Bean Validation through JSF," International Journal of Computer Trends and Technology (IJCTT), vol. 67, no. 4, pp. 24-28, 2019. Crossref, https://doi.org/10.14445/22312803/ IJCTT-V67I4P105

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.

Keywords

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

References

[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