Re: Validation with DynaValidatorForm not working - help

2006-01-13 Thread Mahadevan Venkataraman
I was able to solve the problem. The problem was I was
calling the URL for the form directly from the
browser. Fixed the problem..

Thanks

Maha

--- Mahadevan Venkataraman <[EMAIL PROTECTED]> wrote:

> 
> 
> Here is the stack trace that I got from the
> catalina.log
> 
> Maha
> 
> 
> 
> Jan 11, 2006 3:05:52 PM
> org.apache.struts.validator.DynaValidatorForm
> validate
> SEVERE:
>
org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Object,
> org.apache.commons.validator.ValidatorAction,
> org.apache.commons.validator.Field,
> org.apache.struts.action.ActionErrors,
> javax.servlet.http.HttpServletRequest)
> org.apache.commons.validator.ValidatorException:
>
org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Object,
> org.apache.commons.validator.ValidatorAction,
> org.apache.commons.validator.Field,
> org.apache.struts.action.ActionErrors,
> javax.servlet.http.HttpServletRequest)
>   at
>
org.apache.commons.validator.ValidatorAction.loadValidationMethod(ValidatorAction.java:627)
>   at
>
org.apache.commons.validator.ValidatorAction.executeValidationMethod(ValidatorAction.java:557)
>   at
>
org.apache.commons.validator.Field.validateForRule(Field.java:827)
>   at
>
org.apache.commons.validator.Field.validate(Field.java:906)
>   at
>
org.apache.commons.validator.Form.validate(Form.java:174)
>   at
>
org.apache.commons.validator.Validator.validate(Validator.java:367)
>   at
>
org.apache.struts.validator.DynaValidatorForm.validate(DynaValidatorForm.java:110)
>   at
>
org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:928)
>   at
>
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:204)
>   at
>
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
>   at
>
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
>   at
>
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>   at
>
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>   at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>   at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>   at
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>   at
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>   at
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>   at
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>   at
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>   at
>
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>   at
>
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
>   at
>
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
>   at
>
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
>   at
>
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
>   at
>
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
>   at java.lang.Thread.run(Thread.java:595)
> 
> Maha
> 
> __
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> 


Maha

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: Validation with DynaValidatorForm not working - help

2006-01-12 Thread Vasumathi
can u send ur struts_config.xml file with validator plugin and mentioning 
message_resource class in that file.
also pls send ur jsp in which u want to print error messages.
regards
vasu



Quoting Mahadevan Venkataraman <[EMAIL PROTECTED]>:

> Thanks for the replies.
> 
> Here is more info on the problem that I am having. 
> 
> I used the DynaValidatorForm in the form beans in
> order not to explicitly code the form beans. Also, I
> tried to do both client-side(javascript) and
> server-side validations. The client side validation
> worked. The javascript catches if I try to submit an
> empty form. However, if I remove the client side
> validation and have only the server-side validation,
> the validation does'nt seem to occur . It is not
> throwing the error back to the input page. Instead, it
> starts performing the action as if the form is valid
> eventhough it is empty.
> 
> Any help to solve this is highly appreciated.
> 
> Thanks
> 
> 
> Maha
> 
> __
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 




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



Re: Validation with DynaValidatorForm not working - help

2006-01-12 Thread Mahadevan Venkataraman


Here is the stack trace that I got from the
catalina.log

Maha



Jan 11, 2006 3:05:52 PM
org.apache.struts.validator.DynaValidatorForm validate
SEVERE:
org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
javax.servlet.http.HttpServletRequest)
org.apache.commons.validator.ValidatorException:
org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionErrors,
javax.servlet.http.HttpServletRequest)
at
org.apache.commons.validator.ValidatorAction.loadValidationMethod(ValidatorAction.java:627)
at
org.apache.commons.validator.ValidatorAction.executeValidationMethod(ValidatorAction.java:557)
at
org.apache.commons.validator.Field.validateForRule(Field.java:827)
at
org.apache.commons.validator.Field.validate(Field.java:906)
at
org.apache.commons.validator.Form.validate(Form.java:174)
at
org.apache.commons.validator.Validator.validate(Validator.java:367)
at
org.apache.struts.validator.DynaValidatorForm.validate(DynaValidatorForm.java:110)
at
org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:928)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:204)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)

Maha

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: Validation with DynaValidatorForm not working - help

2006-01-12 Thread Mahadevan Venkataraman
Thanks for the replies.

Here is more info on the problem that I am having. 

I used the DynaValidatorForm in the form beans in
order not to explicitly code the form beans. Also, I
tried to do both client-side(javascript) and
server-side validations. The client side validation
worked. The javascript catches if I try to submit an
empty form. However, if I remove the client side
validation and have only the server-side validation,
the validation does'nt seem to occur . It is not
throwing the error back to the input page. Instead, it
starts performing the action as if the form is valid
eventhough it is empty.

Any help to solve this is highly appreciated.

Thanks


Maha

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: Validation with DynaValidatorForm not working - help

2006-01-12 Thread Vasumathi
Yes mr.vishal in that case we should validate() method.
again i have a doubt, for reducing the class files only we r using 
DynaValidatorForm, but in this suituation use of DynaValidatorForm fails 
know...
there may be a solution for this.
mr.vishal ill search and let u know the solution for that.
if u know anything about this let me it.

Regards
vasu



Quoting Vishal Gaurav <[EMAIL PROTECTED]>:

> I guess that would work if you have validations corresponding to a
> form i.eyou are extending DynaValidatorForm.
> 
> If you need to extend DynaValidatorActionForm, i.e give validations
> corresponding to a action (as single form can be reused in different
> actions
> and not all fields need to be validated in each case) then I feel you need
> a
> call to validate.
> 
> Correct me if I'm wrong :-)
> 
> Regards,
> Vishal
> 
> On 1/12/06, Vasumathi <[EMAIL PROTECTED]> wrote:
> >
> > No mr.vishal i tried thats y im telling.
> > u try without using validate method in local form.
> > we have to mention the validation for each field in validation.xml file
> > itself.
> > no need of calling validate() in local form.
> > definitely it will work.
> >
> >
> >
> > > You are right that there is no need to create a form bean if you are
> > using
> > > dyna form.
> > >
> > > However if you want to link your form with the validation framework
> then
> > > you
> > > do need to create a local form bean. This form bean would not have any
> > > attributes and their getter and setter methods as they all are defined
> > in
> > > Struts config.
> > >
> > > All it would contain is a validate method with a call to super.validate
> > ().
> > > Please refer to the sample code in my last note for reference.
> > >
> > > Regards,
> > > Vishal
> > >
> > > On 1/12/06, Vasumathi <[EMAIL PROTECTED]> wrote:
> > > >
> > > > no need to create a Form class in local. if we are using
> > DynaActionForm,
> > > > then
> > > > no need of create form class in local.
> > > > i tried in struts_config.xml only, it is working well.
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > Quoting Vishal Gaurav <[EMAIL PROTECTED]>:
> > > >
> > > > > Hi,
> > > > >
> > > > > Simply having your dyna form bean of the type Dyna Validator form
> > will
> > > > not
> > > > > work. You have to declare your form bean in the Struts Config as
> > type
> > > > any
> > > > > local form bean you have. ( )
> > > > >
> > > > > Then your ABCForm will extend DynaValidatorForm or
> > > > DynaValidatorActionForm
> > > > > depending on yor requirement.
> > > > >
> > > > > It would have code similar to one given below
> > > > >
> > > > > public class LoginForm  extends DynaValidatorActionForm{
> > > > > public ActionErrors validate(ActionMapping mapping,
> > HttpServletRequest
> > > > > request) {
> > > > >
> > > > >   ActionErrors errors = null;
> > > > >   errors = super.validate(mapping, request);
> > > > >
> > > > >   return errors;
> > > > >   }
> > > > > }
> > > > >
> > > > > Hope this solves your problem.
> > > > >
> > > > >
> > > > > On 1/12/06, Vasumathi <[EMAIL PROTECTED]> wrote:
> > > > > >
> > > > > > sorry u try this one. not previous one.
> > > > > >
> > > > > >  > > > > > type="org.apache.struts.validator.DynaValidatorForm">
> > > > > >
> > > > > >
> > > > > > 
> > > > > >
> > > > > >
> > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Quoting Mahadevan Venkataraman <[EMAIL PROTECTED]>:
> > > > > > >
> > > > > > > > Hi,
> > > > > > > >
> > > > > > > > I am having some problems in  getting struts to
> > > > > > > > validate my input form. It seems to completely ignore
> > > > > > > > the validation and starts executing the action.
> > > > > > > >
> > > > > > > > Here are the relevant files. Any help regarding this
> > > > > > > > is highly appreciated.
> > > > > > > >
> > > > > > > > TIA
> > > > > > > >
> > > > > > > > Maha
> > > > > > > >
> > > > > > > > struts-config.xml
> > > > > > > > --
> > > > > > > >
> > > > > > > > 
> > > > > > > >   
> > > > > > > >> > > > > > >type="forms.ObjectTypeForm"
> > > > > > > > dynamic="true">
> > > > > > > >  > > > > > > > type="java.lang.String"/>
> > > > > > > >  > > > > > > > type="java.lang.String"/>
> > > > > > > >   
> > > > > > > >
> > > > > > > > 
> > > > > > > >
> > > > > > > > the action - mappings contains
> > > > > > > >
> > > > > > > >> > > > > > >  type="actions.ObjectTypeAction"
> > > > > > > >   name="ObjectTypeForm"
> > > > > > > >   scope="request"
> > > > > > > >   validate="true"
> > > > > > > >   input="/objecttype.jsp"
> > > > > > > >   parameter="function">
> > > > > > > >> > > > > > > path="/error.jsp" />
> > > > > > > >> > > > > > > path="/index.jsp" />
> > > > > > > >> > > > > 

Re: Validation with DynaValidatorForm not working - help

2006-01-11 Thread Vishal Gaurav
I guess that would work if you have validations corresponding to a
form i.eyou are extending DynaValidatorForm.

If you need to extend DynaValidatorActionForm, i.e give validations
corresponding to a action (as single form can be reused in different actions
and not all fields need to be validated in each case) then I feel you need a
call to validate.

Correct me if I'm wrong :-)

Regards,
Vishal

On 1/12/06, Vasumathi <[EMAIL PROTECTED]> wrote:
>
> No mr.vishal i tried thats y im telling.
> u try without using validate method in local form.
> we have to mention the validation for each field in validation.xml file
> itself.
> no need of calling validate() in local form.
> definitely it will work.
>
>
>
> > You are right that there is no need to create a form bean if you are
> using
> > dyna form.
> >
> > However if you want to link your form with the validation framework then
> > you
> > do need to create a local form bean. This form bean would not have any
> > attributes and their getter and setter methods as they all are defined
> in
> > Struts config.
> >
> > All it would contain is a validate method with a call to super.validate
> ().
> > Please refer to the sample code in my last note for reference.
> >
> > Regards,
> > Vishal
> >
> > On 1/12/06, Vasumathi <[EMAIL PROTECTED]> wrote:
> > >
> > > no need to create a Form class in local. if we are using
> DynaActionForm,
> > > then
> > > no need of create form class in local.
> > > i tried in struts_config.xml only, it is working well.
> > >
> > >
> > >
> > >
> > >
> > >
> > > Quoting Vishal Gaurav <[EMAIL PROTECTED]>:
> > >
> > > > Hi,
> > > >
> > > > Simply having your dyna form bean of the type Dyna Validator form
> will
> > > not
> > > > work. You have to declare your form bean in the Struts Config as
> type
> > > any
> > > > local form bean you have. ( )
> > > >
> > > > Then your ABCForm will extend DynaValidatorForm or
> > > DynaValidatorActionForm
> > > > depending on yor requirement.
> > > >
> > > > It would have code similar to one given below
> > > >
> > > > public class LoginForm  extends DynaValidatorActionForm{
> > > > public ActionErrors validate(ActionMapping mapping,
> HttpServletRequest
> > > > request) {
> > > >
> > > >   ActionErrors errors = null;
> > > >   errors = super.validate(mapping, request);
> > > >
> > > >   return errors;
> > > >   }
> > > > }
> > > >
> > > > Hope this solves your problem.
> > > >
> > > >
> > > > On 1/12/06, Vasumathi <[EMAIL PROTECTED]> wrote:
> > > > >
> > > > > sorry u try this one. not previous one.
> > > > >
> > > > >  > > > > type="org.apache.struts.validator.DynaValidatorForm">
> > > > >
> > > > >
> > > > > 
> > > > >
> > > > >
> > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > Quoting Mahadevan Venkataraman <[EMAIL PROTECTED]>:
> > > > > >
> > > > > > > Hi,
> > > > > > >
> > > > > > > I am having some problems in  getting struts to
> > > > > > > validate my input form. It seems to completely ignore
> > > > > > > the validation and starts executing the action.
> > > > > > >
> > > > > > > Here are the relevant files. Any help regarding this
> > > > > > > is highly appreciated.
> > > > > > >
> > > > > > > TIA
> > > > > > >
> > > > > > > Maha
> > > > > > >
> > > > > > > struts-config.xml
> > > > > > > --
> > > > > > >
> > > > > > > 
> > > > > > >   
> > > > > > >> > > > > >type="forms.ObjectTypeForm"
> > > > > > > dynamic="true">
> > > > > > >  > > > > > > type="java.lang.String"/>
> > > > > > >  > > > > > > type="java.lang.String"/>
> > > > > > >   
> > > > > > >
> > > > > > > 
> > > > > > >
> > > > > > > the action - mappings contains
> > > > > > >
> > > > > > >> > > > > >  type="actions.ObjectTypeAction"
> > > > > > >   name="ObjectTypeForm"
> > > > > > >   scope="request"
> > > > > > >   validate="true"
> > > > > > >   input="/objecttype.jsp"
> > > > > > >   parameter="function">
> > > > > > >> > > > > > path="/error.jsp" />
> > > > > > >> > > > > > path="/index.jsp" />
> > > > > > >> > > > > > path="/objecttype.jsp" />
> > > > > > >   
> > > > > > >
> > > > > > > The ObjectTypeAction class extends DispatchAction.
> > > > > > >
> > > > > > > validate.xml
> > > > > > > 
> > > > > > >
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > >  > > > > > > depends="required">
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > >
> > > > > > > validation-rules.xml
> > > > > > > 
> > > > > > >
> > > > > > > 
> > > > > > >   
> > > > > > >  > > > > > >
> > > > > > > classname=" org.apache.struts.validator.FieldChecks"
> > > > > > >  method="valid

Re: Validation with DynaValidatorForm not working - help

2006-01-11 Thread Vasumathi
 No mr.vishal i tried thats y im telling.
u try without using validate method in local form.
we have to mention the validation for each field in validation.xml file itself.
no need of calling validate() in local form.
definitely it will work.



> You are right that there is no need to create a form bean if you are using
> dyna form.
> 
> However if you want to link your form with the validation framework then
> you
> do need to create a local form bean. This form bean would not have any
> attributes and their getter and setter methods as they all are defined in
> Struts config.
> 
> All it would contain is a validate method with a call to super.validate().
> Please refer to the sample code in my last note for reference.
> 
> Regards,
> Vishal
> 
> On 1/12/06, Vasumathi <[EMAIL PROTECTED]> wrote:
> >
> > no need to create a Form class in local. if we are using DynaActionForm,
> > then
> > no need of create form class in local.
> > i tried in struts_config.xml only, it is working well.
> >
> >
> >
> >
> >
> >
> > Quoting Vishal Gaurav <[EMAIL PROTECTED]>:
> >
> > > Hi,
> > >
> > > Simply having your dyna form bean of the type Dyna Validator form will
> > not
> > > work. You have to declare your form bean in the Struts Config as type
> > any
> > > local form bean you have. ( )
> > >
> > > Then your ABCForm will extend DynaValidatorForm or
> > DynaValidatorActionForm
> > > depending on yor requirement.
> > >
> > > It would have code similar to one given below
> > >
> > > public class LoginForm  extends DynaValidatorActionForm{
> > > public ActionErrors validate(ActionMapping mapping, HttpServletRequest
> > > request) {
> > >
> > >   ActionErrors errors = null;
> > >   errors = super.validate(mapping, request);
> > >
> > >   return errors;
> > >   }
> > > }
> > >
> > > Hope this solves your problem.
> > >
> > >
> > > On 1/12/06, Vasumathi <[EMAIL PROTECTED]> wrote:
> > > >
> > > > sorry u try this one. not previous one.
> > > >
> > > >  > > > type="org.apache.struts.validator.DynaValidatorForm">
> > > >
> > > >
> > > > 
> > > >
> > > >
> > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > Quoting Mahadevan Venkataraman <[EMAIL PROTECTED]>:
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > > I am having some problems in  getting struts to
> > > > > > validate my input form. It seems to completely ignore
> > > > > > the validation and starts executing the action.
> > > > > >
> > > > > > Here are the relevant files. Any help regarding this
> > > > > > is highly appreciated.
> > > > > >
> > > > > > TIA
> > > > > >
> > > > > > Maha
> > > > > >
> > > > > > struts-config.xml
> > > > > > --
> > > > > >
> > > > > > 
> > > > > >   
> > > > > >> > > > >type="forms.ObjectTypeForm"
> > > > > > dynamic="true">
> > > > > >  > > > > > type="java.lang.String"/>
> > > > > >  > > > > > type="java.lang.String"/>
> > > > > >   
> > > > > >
> > > > > > 
> > > > > >
> > > > > > the action - mappings contains
> > > > > >
> > > > > >> > > > >  type="actions.ObjectTypeAction"
> > > > > >   name="ObjectTypeForm"
> > > > > >   scope="request"
> > > > > >   validate="true"
> > > > > >   input="/objecttype.jsp"
> > > > > >   parameter="function">
> > > > > >> > > > > path="/error.jsp" />
> > > > > >> > > > > path="/index.jsp" />
> > > > > >> > > > > path="/objecttype.jsp" />
> > > > > >   
> > > > > >
> > > > > > The ObjectTypeAction class extends DispatchAction.
> > > > > >
> > > > > > validate.xml
> > > > > > 
> > > > > >
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > >  > > > > > depends="required">
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > >
> > > > > > validation-rules.xml
> > > > > > 
> > > > > >
> > > > > > 
> > > > > >   
> > > > > >  > > > > >
> > > > > > classname=" org.apache.struts.validator.FieldChecks"
> > > > > >  method="validateRequired"
> > > > > >methodParams="java.lang.Object,
> > > > > >
> > > > > > org.apache.commons.validator.ValidatorAction ,
> > > > > >
> > > > > > org.apache.commons.validator.Field,
> > > > > >
> > > > > > org.apache.struts.action.ActionErrors,
> > > > > >
> > > > > > javax.servlet.http.HttpServletRequest"
> > > > > > msg="errors.required">
> > > > > > 
> > > > > >   
> > > > > > 
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > __
> > > > > > Do You Yahoo!?
> > > > > > Tired of spam?  Yahoo! Mail has the best spam protection around
> > > > > > http://mail.yahoo.com
> > > > > >
> > > > > >
> > ---

Re: Validation with DynaValidatorForm not working - help

2006-01-11 Thread Vishal Gaurav
You are right that there is no need to create a form bean if you are using
dyna form.

However if you want to link your form with the validation framework then you
do need to create a local form bean. This form bean would not have any
attributes and their getter and setter methods as they all are defined in
Struts config.

All it would contain is a validate method with a call to super.validate().
Please refer to the sample code in my last note for reference.

Regards,
Vishal

On 1/12/06, Vasumathi <[EMAIL PROTECTED]> wrote:
>
> no need to create a Form class in local. if we are using DynaActionForm,
> then
> no need of create form class in local.
> i tried in struts_config.xml only, it is working well.
>
>
>
>
>
>
> Quoting Vishal Gaurav <[EMAIL PROTECTED]>:
>
> > Hi,
> >
> > Simply having your dyna form bean of the type Dyna Validator form will
> not
> > work. You have to declare your form bean in the Struts Config as type
> any
> > local form bean you have. ( )
> >
> > Then your ABCForm will extend DynaValidatorForm or
> DynaValidatorActionForm
> > depending on yor requirement.
> >
> > It would have code similar to one given below
> >
> > public class LoginForm  extends DynaValidatorActionForm{
> > public ActionErrors validate(ActionMapping mapping, HttpServletRequest
> > request) {
> >
> >   ActionErrors errors = null;
> >   errors = super.validate(mapping, request);
> >
> >   return errors;
> >   }
> > }
> >
> > Hope this solves your problem.
> >
> >
> > On 1/12/06, Vasumathi <[EMAIL PROTECTED]> wrote:
> > >
> > > sorry u try this one. not previous one.
> > >
> > >  > > type="org.apache.struts.validator.DynaValidatorForm">
> > >
> > >
> > > 
> > >
> > >
> > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > Quoting Mahadevan Venkataraman <[EMAIL PROTECTED]>:
> > > >
> > > > > Hi,
> > > > >
> > > > > I am having some problems in  getting struts to
> > > > > validate my input form. It seems to completely ignore
> > > > > the validation and starts executing the action.
> > > > >
> > > > > Here are the relevant files. Any help regarding this
> > > > > is highly appreciated.
> > > > >
> > > > > TIA
> > > > >
> > > > > Maha
> > > > >
> > > > > struts-config.xml
> > > > > --
> > > > >
> > > > > 
> > > > >   
> > > > >> > > >type="forms.ObjectTypeForm"
> > > > > dynamic="true">
> > > > >  > > > > type="java.lang.String"/>
> > > > >  > > > > type="java.lang.String"/>
> > > > >   
> > > > >
> > > > > 
> > > > >
> > > > > the action - mappings contains
> > > > >
> > > > >> > > >  type="actions.ObjectTypeAction"
> > > > >   name="ObjectTypeForm"
> > > > >   scope="request"
> > > > >   validate="true"
> > > > >   input="/objecttype.jsp"
> > > > >   parameter="function">
> > > > >> > > > path="/error.jsp" />
> > > > >> > > > path="/index.jsp" />
> > > > >> > > > path="/objecttype.jsp" />
> > > > >   
> > > > >
> > > > > The ObjectTypeAction class extends DispatchAction.
> > > > >
> > > > > validate.xml
> > > > > 
> > > > >
> > > > > 
> > > > > 
> > > > > 
> > > > >  > > > > depends="required">
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > >
> > > > > validation-rules.xml
> > > > > 
> > > > >
> > > > > 
> > > > >   
> > > > >  > > > >
> > > > > classname=" org.apache.struts.validator.FieldChecks"
> > > > >  method="validateRequired"
> > > > >methodParams="java.lang.Object,
> > > > >
> > > > > org.apache.commons.validator.ValidatorAction ,
> > > > >
> > > > > org.apache.commons.validator.Field,
> > > > >
> > > > > org.apache.struts.action.ActionErrors,
> > > > >
> > > > > javax.servlet.http.HttpServletRequest"
> > > > > msg="errors.required">
> > > > > 
> > > > >   
> > > > > 
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > __
> > > > > Do You Yahoo!?
> > > > > Tired of spam?  Yahoo! Mail has the best spam protection around
> > > > > http://mail.yahoo.com
> > > > >
> > > > >
> -
> > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> -
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > >
> > >
> > >
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
> > --
> >

Re: Validation with DynaValidatorForm not working - help

2006-01-11 Thread Vasumathi
no need to create a Form class in local. if we are using DynaActionForm, then 
no need of create form class in local.
i tried in struts_config.xml only, it is working well.






Quoting Vishal Gaurav <[EMAIL PROTECTED]>:

> Hi,
> 
> Simply having your dyna form bean of the type Dyna Validator form will not
> work. You have to declare your form bean in the Struts Config as type any
> local form bean you have. ( )
> 
> Then your ABCForm will extend DynaValidatorForm or DynaValidatorActionForm
> depending on yor requirement.
> 
> It would have code similar to one given below
> 
> public class LoginForm  extends DynaValidatorActionForm{
> public ActionErrors validate(ActionMapping mapping, HttpServletRequest
> request) {
> 
>   ActionErrors errors = null;
>   errors = super.validate(mapping, request);
> 
>   return errors;
>   }
> }
> 
> Hope this solves your problem.
> 
> 
> On 1/12/06, Vasumathi <[EMAIL PROTECTED]> wrote:
> >
> > sorry u try this one. not previous one.
> >
> >  > type="org.apache.struts.validator.DynaValidatorForm">
> >
> >
> > 
> >
> >
> >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > Quoting Mahadevan Venkataraman <[EMAIL PROTECTED]>:
> > >
> > > > Hi,
> > > >
> > > > I am having some problems in  getting struts to
> > > > validate my input form. It seems to completely ignore
> > > > the validation and starts executing the action.
> > > >
> > > > Here are the relevant files. Any help regarding this
> > > > is highly appreciated.
> > > >
> > > > TIA
> > > >
> > > > Maha
> > > >
> > > > struts-config.xml
> > > > --
> > > >
> > > > 
> > > >   
> > > >> > >type="forms.ObjectTypeForm"
> > > > dynamic="true">
> > > >  > > > type="java.lang.String"/>
> > > >  > > > type="java.lang.String"/>
> > > >   
> > > >
> > > > 
> > > >
> > > > the action - mappings contains
> > > >
> > > >> > >  type="actions.ObjectTypeAction"
> > > >   name="ObjectTypeForm"
> > > >   scope="request"
> > > >   validate="true"
> > > >   input="/objecttype.jsp"
> > > >   parameter="function">
> > > >> > > path="/error.jsp" />
> > > >> > > path="/index.jsp" />
> > > >> > > path="/objecttype.jsp" />
> > > >   
> > > >
> > > > The ObjectTypeAction class extends DispatchAction.
> > > >
> > > > validate.xml
> > > > 
> > > >
> > > > 
> > > > 
> > > > 
> > > >  > > > depends="required">
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > >
> > > > validation-rules.xml
> > > > 
> > > >
> > > > 
> > > >   
> > > >  > > >
> > > > classname=" org.apache.struts.validator.FieldChecks"
> > > >  method="validateRequired"
> > > >methodParams="java.lang.Object,
> > > >
> > > > org.apache.commons.validator.ValidatorAction ,
> > > >
> > > > org.apache.commons.validator.Field,
> > > >
> > > > org.apache.struts.action.ActionErrors,
> > > >
> > > > javax.servlet.http.HttpServletRequest"
> > > > msg="errors.required">
> > > > 
> > > >   
> > > > 
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > __
> > > > Do You Yahoo!?
> > > > Tired of spam?  Yahoo! Mail has the best spam protection around
> > > > http://mail.yahoo.com
> > > >
> > > > -
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > >
> > >
> > >
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> >
> >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> 
> --
> Thanks and Regards,
> Vishal Gaurav
> Ph : 9810482236
> Email : [EMAIL PROTECTED]
> 




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



Re: Validation with DynaValidatorForm not working - help

2006-01-11 Thread Vishal Gaurav
Hi,

Simply having your dyna form bean of the type Dyna Validator form will not
work. You have to declare your form bean in the Struts Config as type any
local form bean you have. ( )

Then your ABCForm will extend DynaValidatorForm or DynaValidatorActionForm
depending on yor requirement.

It would have code similar to one given below

public class LoginForm  extends DynaValidatorActionForm{
public ActionErrors validate(ActionMapping mapping, HttpServletRequest
request) {

  ActionErrors errors = null;
  errors = super.validate(mapping, request);

  return errors;
  }
}

Hope this solves your problem.


On 1/12/06, Vasumathi <[EMAIL PROTECTED]> wrote:
>
> sorry u try this one. not previous one.
>
>  type="org.apache.struts.validator.DynaValidatorForm">
>
>
> 
>
>
>
> >
> >
> >
> >
> >
> >
> >
> >
> > Quoting Mahadevan Venkataraman <[EMAIL PROTECTED]>:
> >
> > > Hi,
> > >
> > > I am having some problems in  getting struts to
> > > validate my input form. It seems to completely ignore
> > > the validation and starts executing the action.
> > >
> > > Here are the relevant files. Any help regarding this
> > > is highly appreciated.
> > >
> > > TIA
> > >
> > > Maha
> > >
> > > struts-config.xml
> > > --
> > >
> > > 
> > >   
> > >> >type="forms.ObjectTypeForm"
> > > dynamic="true">
> > >  > > type="java.lang.String"/>
> > >  > > type="java.lang.String"/>
> > >   
> > >
> > > 
> > >
> > > the action - mappings contains
> > >
> > >> >  type="actions.ObjectTypeAction"
> > >   name="ObjectTypeForm"
> > >   scope="request"
> > >   validate="true"
> > >   input="/objecttype.jsp"
> > >   parameter="function">
> > >> > path="/error.jsp" />
> > >> > path="/index.jsp" />
> > >> > path="/objecttype.jsp" />
> > >   
> > >
> > > The ObjectTypeAction class extends DispatchAction.
> > >
> > > validate.xml
> > > 
> > >
> > > 
> > > 
> > > 
> > >  > > depends="required">
> > > 
> > > 
> > > 
> > > 
> > > 
> > >
> > > validation-rules.xml
> > > 
> > >
> > > 
> > >   
> > >  > >
> > > classname=" org.apache.struts.validator.FieldChecks"
> > >  method="validateRequired"
> > >methodParams="java.lang.Object,
> > >
> > > org.apache.commons.validator.ValidatorAction ,
> > >
> > > org.apache.commons.validator.Field,
> > >
> > > org.apache.struts.action.ActionErrors,
> > >
> > > javax.servlet.http.HttpServletRequest"
> > > msg="errors.required">
> > > 
> > >   
> > > 
> > >
> > >
> > >
> > >
> > >
> > >
> > > __
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam protection around
> > > http://mail.yahoo.com
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> >
> >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Thanks and Regards,
Vishal Gaurav
Ph : 9810482236
Email : [EMAIL PROTECTED]


Re: Validation with DynaValidatorForm not working - help

2006-01-11 Thread Vasumathi
sorry u try this one. not previous one.
 
 


 
 
 
 
> 
> 
> 
> 
> 
> 
> 
> 
> Quoting Mahadevan Venkataraman <[EMAIL PROTECTED]>:
> 
> > Hi,
> > 
> > I am having some problems in  getting struts to
> > validate my input form. It seems to completely ignore
> > the validation and starts executing the action. 
> > 
> > Here are the relevant files. Any help regarding this
> > is highly appreciated.
> > 
> > TIA 
> > 
> > Maha
> > 
> > struts-config.xml
> > --
> > 
> > 
> >   
> >>type="forms.ObjectTypeForm"
> > dynamic="true">
> >  > type="java.lang.String"/>
> >  > type="java.lang.String"/>
> >   
> > 
> > 
> > 
> > the action - mappings contains
> >  
> >>  type="actions.ObjectTypeAction"
> >   name="ObjectTypeForm"
> >   scope="request"
> >   validate="true"
> >   input="/objecttype.jsp"
> >   parameter="function">
> >> path="/error.jsp" />
> >> path="/index.jsp" />
> >> path="/objecttype.jsp" />
> >   
> > 
> > The ObjectTypeAction class extends DispatchAction.
> > 
> > validate.xml
> > 
> > 
> > 
> > 
> > 
> >  > depends="required">
> > 
> > 
> > 
> > 
> > 
> > 
> > validation-rules.xml
> > 
> > 
> > 
> >   
> >  >  
> > classname="org.apache.struts.validator.FieldChecks"
> >  method="validateRequired"
> >methodParams="java.lang.Object,
> > 
> > org.apache.commons.validator.ValidatorAction,
> > 
> > org.apache.commons.validator.Field,
> > 
> > org.apache.struts.action.ActionErrors,
> > 
> > javax.servlet.http.HttpServletRequest"
> > msg="errors.required">
> > 
> >   
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > __
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam protection around 
> > http://mail.yahoo.com 
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 




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



Re: Validation with DynaValidatorForm not working - help

2006-01-11 Thread Vasumathi
Try like this in struts-config.xml file.
i hope it will work.



   
   












Quoting Mahadevan Venkataraman <[EMAIL PROTECTED]>:

> Hi,
> 
> I am having some problems in  getting struts to
> validate my input form. It seems to completely ignore
> the validation and starts executing the action. 
> 
> Here are the relevant files. Any help regarding this
> is highly appreciated.
> 
> TIA 
> 
> Maha
> 
> struts-config.xml
> --
> 
> 
>   
>   type="forms.ObjectTypeForm"
> dynamic="true">
>  type="java.lang.String"/>
>  type="java.lang.String"/>
>   
> 
> 
> 
> the action - mappings contains
>  
> type="actions.ObjectTypeAction"
>   name="ObjectTypeForm"
>   scope="request"
>   validate="true"
>   input="/objecttype.jsp"
>   parameter="function">
>path="/error.jsp" />
>path="/index.jsp" />
>path="/objecttype.jsp" />
>   
> 
> The ObjectTypeAction class extends DispatchAction.
> 
> validate.xml
> 
> 
> 
> 
> 
>  depends="required">
> 
> 
> 
> 
> 
> 
> validation-rules.xml
> 
> 
> 
>   
>   
> classname="org.apache.struts.validator.FieldChecks"
>  method="validateRequired"
>methodParams="java.lang.Object,
> 
> org.apache.commons.validator.ValidatorAction,
> 
> org.apache.commons.validator.Field,
> 
> org.apache.struts.action.ActionErrors,
> 
> javax.servlet.http.HttpServletRequest"
> msg="errors.required">
> 
>   
> 
> 
> 
> 
> 
> 
> 
> __
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 




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



Re: Validation with DynaValidatorForm not working - help

2006-01-11 Thread Raghu Kanchustambham
Assuming you want to do "form-based" validation, can you check if your
forms.ObjectTypeForm extends from one of the valid validationform objects?

If it extends a simple "ActionForm", validation will not work.

HTH,
Raghu


On 1/11/06, Mahadevan Venkataraman <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I am having some problems in  getting struts to
> validate my input form. It seems to completely ignore
> the validation and starts executing the action.
>
> Here are the relevant files. Any help regarding this
> is highly appreciated.
>
> TIA
>
> Maha
>
> struts-config.xml
> --
>
>
>  
> type="forms.ObjectTypeForm"
> dynamic="true">
> type="java.lang.String"/>
> type="java.lang.String"/>
>  
>
>
>
> the action - mappings contains
>
>   type="actions.ObjectTypeAction"
>  name="ObjectTypeForm"
>  scope="request"
>  validate="true"
>  input="/objecttype.jsp"
>  parameter="function">
>   path="/error.jsp" />
>   path="/index.jsp" />
>   path="/objecttype.jsp" />
>  
>
> The ObjectTypeAction class extends DispatchAction.
>
> validate.xml
> 
>
> 
>
>
> depends="required">
>
>
>
>
> 
>
> validation-rules.xml
> 
>
> 
> 
>
> classname="org.apache.struts.validator.FieldChecks"
> method="validateRequired"
>   methodParams="java.lang.Object,
>
> org.apache.commons.validator.ValidatorAction,
>
> org.apache.commons.validator.Field,
>
> org.apache.struts.action.ActionErrors,
>
> javax.servlet.http.HttpServletRequest"
>msg="errors.required">
>
> 
> 
>
>
>
>
>
>
> __
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>