java_ struts _validatorform vs validatoractionform.pdf

Upload: rithuik1598

Post on 14-Apr-2018

223 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/27/2019 Java_ Struts _ValidatorForm Vs ValidatorActionForm.pdf

    1/3

    10/21/13 Java: Struts :ValidatorForm Vs ValidatorActionForm

    maddy4java.blogspot.in/2012/07/struts-validatorform-vs.html

    Java

    Saturday, July 7, 2012

    Posted by MADDYat 1:27 PM

    Struts :ValidatorForm Vs ValidatorActionFormRecommend this on Google

    ValidatorForm ValidatorActionForm

    What Class provided by struts

    framework for val idating form

    fields

    Clas s provi ded by struts framework for

    validating form fields

    Why Instead of manually using basic

    validation using validate() method

    in action cla ss, harnesses the rich

    feature of val idation framework(

    or descriptive validation)

    provided by the struts using XML

    Files(Validation-rule.xml &validations.xml)

    Instead of manually usi ng basic

    validation using validate() method in

    action class, harnesses the rich feature

    of validation framework( or descriptive

    validation) provided by the struts using

    XML Files(Validation-rule.xml &

    validations.xml)

    How By extending the form class

    Ex:

    Public class MyForm extends

    ValidatorForm{

    properties & getters setters

    By extending the form class

    Ex:

    Public class MyForm extends

    ValidatorActionForm{

    properties & getters setters

    Where In any web application which is

    implemented using struts

    In any web application which is

    implemented using struts

    Di fference It uses form name as identi fier to

    invoke validation

    It uses action name as i dentifier to

    invoke validation

    The validations.xml file will be

    configured as

    Ex

    Validations.xml

    ---------------------------

    ----------------------------

    struts-config.xml

  • 7/27/2019 Java_ Struts _ValidatorForm Vs ValidatorActionForm.pdf

    2/3

    10/21/13 Java: Struts :ValidatorForm Vs ValidatorActionForm

    maddy4java.blogspot.in/2012/07/struts-validatorform-vs.html

    Newer Post Older PostHome

    Subscribe to: Post Comments (Atom)

    Labels:Advanced Java

    type= -------- >

    --- >

    Benefi t Its a cl ear cut way to s ay that thi s

    form has following vali dations.

    Some times i t happens that a si ngle

    form is shared by many actions or JSP

    pages so to configure a single

    validation for form would be overkill,

    we are wasting time by valida ting all

    fields which are not related to our

    page.

    A page can be disti nguished using

    Action so i t is being used here to save

    us from wastage.

    Complete Example :

    Wil l be posted on 09th July 2012.

    Post a Comment

    4 comments:

    Anonymous said...

    Very Good comparis on,can you please give me com parison between all available

    action forms.

    June 2, 2013 at 3:58 PM

    Anonymous said...

    Great comparison can you please provide Tiles sam ple program as well for struts 1.3.

    June 15, 2013 at 8:57 AM

    Anonymous said...

    You have written execute(AM,AF,HSR,HSR) in ActionForm I think execute(,,,,) is in

    Action right?

    September 30, 2013 at 9:34 AM

    MADDYsaid...

    sorry Yup its my typo

    October 4, 2013 at 12:45 PM

    MADDY

    A knowledge seeker with l ittle knowledge but sincere to answer.

    About Me

    http://www.blogger.com/profile/13752094420978164934http://maddy4java.blogspot.com/2012/07/struts-validatorform-vs.html?showComment=1380870928158#c8083226412105337818http://www.blogger.com/profile/13752094420978164934http://maddy4java.blogspot.com/2012/07/struts-validatorform-vs.html?showComment=1380513859824#c4416524960037047360http://maddy4java.blogspot.com/2012/07/struts-validatorform-vs.html?showComment=1371266866986#c6542240490314257096http://maddy4java.blogspot.com/2012/07/struts-validatorform-vs.html?showComment=1370168924937#c3865091163908007646http://www.blogger.com/comment.g?blogID=7202247527617724046&postID=3568158759989638269&isPopup=truehttp://maddy4java.blogspot.in/search/label/Advanced%20Javahttp://maddy4java.blogspot.com/feeds/3568158759989638269/comments/defaulthttp://maddy4java.blogspot.in/http://maddy4java.blogspot.in/2012/07/servlet-life-cycle.htmlhttp://maddy4java.blogspot.in/2012/07/custom-tag-lifecycleclassical.html
  • 7/27/2019 Java_ Struts _ValidatorForm Vs ValidatorActionForm.pdf

    3/3