RE: Validation in Struts DisptachAction

2006-08-24 Thread Sherwood, Reg
Hi Vaneet
 
I'm no expert on this to be sure; but I ran into a similiar issue.  What I did 
was provided the check for the Read only mode in the forms validate method; if 
read only mode the validate method returned null; otherwise it invoked the 
super.validate method which performs the normal validation checks on the form.
 
Hope this helps.
 
Reg



From: Vaneet Sharma [mailto:[EMAIL PROTECTED]
Sent: Thu 24/08/2006 8:08 AM
To: struts-user@jakarta.apache.org
Subject: Validation in Struts DisptachAction



Hii

I am using Struts  DispatchAction and i am facing  a peculiar problem
while validating .
Now i want to validate ,my action form only in insert or update mode.
For read mode i want to prevent validation.
To achive this is am writing validation="false" in the action mapping ,
and i am manually calling validation in insert and update methods of my
action class.


 DynaActionForm frm=(DynaActionForm)form;
  ActionErrors  errors=frm.validate(mapping,request);
 if ( errors != null && !errors.isEmpty() ) {
   saveErrors(request, errors);
  return (mapping.findForward("validationfailure"));
}


But when i am doing validation in this way.
It is always trying to validate the action , even in read mode also.
Can anybody tell me why is this happening.

Thanx in advance


Disclaimer :
This message and any attachments (hereinafter referred to as the Said 
Information) are  intended solely for the addressee. The Said Information is 
confidential and may be privileged and is also prohibited from disclosure. 
Access, use, copying, distribution or e-use of the Said Information by anyone 
except the addressee is unauthorized. If you are not the intended addressee, 
please destroy all copies of  the Said Information in your possession and also 
delete the same from your computer. Any views expressed in the Said Information 
are those of the individual sender except where the sender, with due authority 
of CRISIL Ltd./CRISIL MarketWire Ltd./Global Data Services of India Ltd. 
specifically states them to be the views of CRISIL Ltd./CRISIL MarketWire 
Ltd./Global Data Services of India Ltd. Nothing contained in the Said 
Information is capable or intended to create any legally binding obligations on 
the sender  CRISIL Ltd./CRISIL MarketWire Ltd./Global Data Services of India L
 td. who accept no responsibility, whatsoever, for loss or damage from the use 
of  the Said Information including damage from viruses.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

RE: Validation in Struts DisptachAction

2006-08-24 Thread Saeed, Rada
Sharma,
 If insert, update and read modes, are represented by 3 different
submits that trigger the actions,
make them 3 different action mappings, then put validate="false" in the
read action mapping, and true in the rest.















-Original Message-
From: Vaneet Sharma [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 24, 2006 2:09 PM
To: struts-user@jakarta.apache.org
Subject: Validation in Struts DisptachAction

Hii

I am using Struts  DispatchAction and i am facing  a peculiar problem
while validating .
Now i want to validate ,my action form only in insert or update mode.
For read mode i want to prevent validation.
To achive this is am writing validation="false" in the action mapping ,
and i am manually calling validation in insert and update methods of my
action class.


 DynaActionForm frm=(DynaActionForm)form;
  ActionErrors  errors=frm.validate(mapping,request);
 if ( errors != null && !errors.isEmpty() ) {
   saveErrors(request, errors);
  return (mapping.findForward("validationfailure"));
}


But when i am doing validation in this way.
It is always trying to validate the action , even in read mode also.
Can anybody tell me why is this happening.

Thanx in advance


Disclaimer : 
This message and any attachments (hereinafter referred to as the Said
Information) are  intended solely for the addressee. The Said
Information is confidential and may be privileged and is also prohibited
from disclosure. Access, use, copying, distribution or e-use of the Said
Information by anyone except the addressee is unauthorized. If you are
not the intended addressee, please destroy all copies of  the Said
Information in your possession and also delete the same from your
computer. Any views expressed in the Said Information are those of the
individual sender except where the sender, with due authority of CRISIL
Ltd./CRISIL MarketWire Ltd./Global Data Services of India Ltd.
specifically states them to be the views of CRISIL Ltd./CRISIL
MarketWire Ltd./Global Data Services of India Ltd. Nothing contained in
the Said Information is capable or intended to create any legally
binding obligations on the sender  CRISIL Ltd./CRISIL MarketWire
Ltd./Global Data Services of India L  td. who accept no responsibility,
whatsoever, for loss or damage from the use of  the Said Information
including damage from viruses.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]