• Learn Struts,  Validator Plug-in

    Struts2 Validation with Example

    Struts Validation is plugin is a mandatory and important for any web application, Validating is an important part of any web framework because it is one of the most painfully repetitive things to do.  In Struts 2, validation plugin is created with use of an < ActionClassName>-validation.xml file.  So, if we have an AddEmployee Action then we would create an AddEmployee-validation.xml file, Please find below one for AddEmployee: <!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"><validators> <field name="employeeId"> <field-validator type="requiredstring"> <message>Employee Name is required.</message> </field-validator> </field></validators>   It is *required to have both getters and setters for the field you are validating for.  As class AddEmployee will require both of…

    Comments Off on Struts2 Validation with Example
  • Action,  ActionForm,  Controler,  Learn Struts,  Model,  Struts 1.x,  Struts 2,  Struts Components,  Tiles Plug-in,  Validator Plug-in,  View

    What are the different components for struts application?

    Struts 1.x Framework have following components in its application: struts-config.xml ActionForm Bean View(JSP or ftl) Action Class Model (DAO,DTO classes) And may have following extensible component for Application: Validator.xml Validator class tiles-defs.xml Your comments give us opportunity to improve my blogs, so please comment.

    Comments Off on What are the different components for struts application?