Results 1 to 5 of 5

Thread: New to Struts

  1. #1
    Swamipsn is offline Member
    Join Date
    Jul 2007
    Posts
    74
    Rep Power
    0

    Smile New to Struts

    Hi,

    I am new To Struts can any one explain to me What is validator and how to use it..? many thanks...?

  2. #2
    arfatkhan is offline Member
    Join Date
    Jul 2007
    Posts
    9
    Rep Power
    0

    Default

    Hi,

    In struts validator framwork. This used for client side validation.
    There are 2 important files
    Validation.xml and Validator-rules.xml

    In Validator-rules.xml all Validation rules will be available.
    In validaor.xml you need to mention the form name for which you are validating and field name and some other information.

  3. #3
    Swamipsn is offline Member
    Join Date
    Jul 2007
    Posts
    74
    Rep Power
    0

    Default

    Tanks...But I am able to use validator but if the validation found false e.g Name field is set as "required" how can I print a error message from Action class to a JSP page

  4. #4
    anki1234 is offline Member
    Join Date
    Dec 2007
    Posts
    28
    Rep Power
    0

    Default

    Put the messaege error{0}is required in ur Application properties ( Copy from the validator-rules.xml)
    and then retrieve formbean object=field value in the same Application properties file
    it wl work

  5. #5
    kzvi.kzvi.1 is offline Member
    Join Date
    Oct 2008
    Location
    US
    Posts
    58
    Rep Power
    0

    Default

    For others benefit, here is a link which has struts validation example
    Strtus 2 Validation Example

    ____________________________________________
    Software Wiki | Interview FAQs | Lucene Search | Oracle | ORM | Struts2 | Job Seeker
    Have fun....
    JAVA FAQs

Similar Threads

  1. Struts or JSF?
    By Swamipsn in forum Web Frameworks
    Replies: 0
    Last Post: 08-01-2007, 10:10 AM
  2. Struts or JSF?
    By Swamipsn in forum New To Java
    Replies: 0
    Last Post: 08-01-2007, 05:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •