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]
>
>


Re: Validation Problem - very urgent please reply

2006-01-10 Thread Raghu Kanchustambham
The trick is to point the "input" variable in your struts-config.xml to the
action class that "generated" the JSP page rather than the JSP page itself.

 

On failure of validation, you should redirect it to the "preparation" action
class for the form that solicits information for you - the action class
where you would be populating the "arraylist" that you are using in the JSP.

HTH,
~raghu~


On 1/10/06, Sony Thomas <[EMAIL PROTECTED]> wrote:
>
> Dear friends,
>
> I have a Add user jsp page and in my jsp page the user can select his
> language from a dropdown menu. I am generating it from the ArrayList
> property in UserForm.
>
>
> tabindex="8">
> property="languages" label="name" value="code"/>
>
>
>
> My problem is ,  when there is a validation error and control returns to
> the jsp page it is not able to find the languages collection, ie
> ArrayList. I know it is possible to solve by setting the form to
> session. but I dont want it to be in the session. Is there is any way
> out for this problem ??
>
> Please reply to me
>
> thanks in advance
>
>
> Sony
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Validation Problem - very urgent please reply

2006-01-10 Thread Vishal Gaurav
Hi,

I feel that the approach given by Peter would be fine.

You might be populating the drop down by iterating a collection fetched from
Database. When you submit the form only the selected value is submitted from
the drop down not the entire collection (That is why you do not get the
collection back on page load after validation failure).

Ideal workaround is to iterate the entire collection again within the JSP
and submit the same as hidden.

If your collection is of some object having attributes like id and value
then you need to submit two separate collections one for each type of
attribute.

In this case you need to ensure that in your form bean if there is a
validation error you need to map the hidden collection back into the form
just the way you do it while loading the page from the action class. You
will need to iterate through both the collections and remake the collection
of objects from the same and set it into the appropriate form property.

Please let me know if you need any further information.

Regards,
Vishal

On 1/10/06, Meenakshi Singh <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I would suggest that manually call validate and use Request Scope
> Not many people seem to be using this approach, yet I have found it to be
> the best overall solution.
>
> This is how it works:
> First of all make sure you do not have validate="true" set in your action
> mapping.You should call form.validate(..) manually.
>
> Then create a method to set up your request with any lists in scope. For
> example if you are using a DispatchAction you can simply have a private
> setUp(..) method in this Action. If you are creating separate Action
> classes
> for all of your different actions you might want to make this a separate
> class, or put it in a base Action class that your Actions can extend from.
> Now manually call your form's validate method, and then, based on whether
> ActionErrors return or not, you can decide what to do. If ActionErrors
> returns null/empty then validation was successful and you can continue
> your
> processing and forward on to success. If ActionErrors is not null/not
> empty,
> you have validation errors and need to call the setUp method to repopulate
> any lists then forward back to the JSP form.
>
> I am pasting a sample code from an article from a website to implement the
> above.
> You can look at this sample code & then try to implement it at your end.
>
>
> //class EmployeeDispatchAction
>
> private void setUp( HttpServletRequest request ) {
> Collection jobCodes = Service.getJobCodes();
> request.setAttribute("jobCodes", jobCodes);
> }
>
> public ActionForward setUpForm(ActionMapping mapping, ...) throws
> Exception {
> setUp( request );
> return (mapping.findForward(UIconstants.TO_FORM));
> }
>
> public ActionForward update(ActionMapping mapping, ...) throws
> Exception
> {
> ActionErrors errors = form.validate( mapping, request );
> if ( errors != null && !errors.isEmpty ) {
> saveErrors(request, errors);
> setUp(request);
> return (mapping.findForward(UIconstants.VALIDATION_FAILURE));
> }
> //Everything OK, continue on...
> return (mapping.findForward(UIconstants.SUCCESS));
> }
>
>
> Give it a try!!!
>
> Thanks & Regards,
> Meenakshi.
>
> PS: Let me know whether it worked for you or not.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


RE: Validation Problem - very urgent please reply

2006-01-10 Thread Meenakshi Singh
Hi,

I would suggest that manually call validate and use Request Scope
Not many people seem to be using this approach, yet I have found it to be
the best overall solution.

This is how it works:
First of all make sure you do not have validate=”true” set in your action
mapping.You should call form.validate(..) manually.

Then create a method to set up your request with any lists in scope. For
example if you are using a DispatchAction you can simply have a private
setUp(..) method in this Action. If you are creating separate Action classes
for all of your different actions you might want to make this a separate
class, or put it in a base Action class that your Actions can extend from.
Now manually call your form’s validate method, and then, based on whether
ActionErrors return or not, you can decide what to do. If ActionErrors
returns null/empty then validation was successful and you can continue your
processing and forward on to success. If ActionErrors is not null/not empty,
you have validation errors and need to call the setUp method to repopulate
any lists then forward back to the JSP form.

I am pasting a sample code from an article from a website to implement the
above.
You can look at this sample code & then try to implement it at your end.


//class EmployeeDispatchAction

private void setUp( HttpServletRequest request ) {
Collection jobCodes = Service.getJobCodes();
request.setAttribute(“jobCodes”, jobCodes);
}

public ActionForward setUpForm(ActionMapping mapping, ...) throws
Exception {
setUp( request );
return (mapping.findForward(UIconstants.TO_FORM));
}

public ActionForward update(ActionMapping mapping, ...) throws Exception
{
ActionErrors errors = form.validate( mapping, request );
if ( errors != null && !errors.isEmpty ) {
saveErrors(request, errors);
setUp(request);
return (mapping.findForward(UIconstants.VALIDATION_FAILURE));
}
//Everything OK, continue on...
return (mapping.findForward(UIconstants.SUCCESS));
}


Give it a try!!!

Thanks & Regards,
Meenakshi.

PS: Let me know whether it worked for you or not.


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



RE: Validation Problem - very urgent please reply

2006-01-10 Thread Peter . Zoche
I had the same problem, and besides setting the form to session scope
you could do the following: Instead of storing your list of languages in
an ArrayList, store them in an array of Strings. Then on your jsp you
should be able to iterate over this list and sent all languages via the
html:hidden tag (that is why you have to use Strings, because they are sent
as Strings) with your request. So the languages are stored in your form with
every request, and when validation fails, you still have the languages
there.
The iteration should look something like this:





Hope that helps, perhaps you could reply when it works!

Peter

-Ursprüngliche Nachricht-
Von: Sony Thomas [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 10. Januar 2006 10:51
An: user@struts.apache.org
Betreff: Validation Problem - very urgent please reply


Dear friends,

I have a Add user jsp page and in my jsp page the user can select his 
language from a dropdown menu. I am generating it from the ArrayList 
property in UserForm.







My problem is ,  when there is a validation error and control returns to 
the jsp page it is not able to find the languages collection, ie 
ArrayList. I know it is possible to solve by setting the form to 
session. but I dont want it to be in the session. Is there is any way 
out for this problem ??

Please reply to me

thanks in advance


Sony

-
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 in ie5

2006-01-05 Thread Niall Pemberton
Can you submit a bugzilla against Commons Validator for this and then I'll
look at trying patching in your suggestion. Thx.

http://jakarta.apache.org/commons/validator/issue-tracking.html

Niall

- Original Message - 
From: <[EMAIL PROTECTED]>
To: <'user@struts.apache.org'>
Sent: Thursday, January 05, 2006 2:10 PM
Subject: Re: Validation in ie5

Hi, I changed the retrieveFormName method so it now lookes like this :

function retrieveFormName(form) {

var x;

if (form.getAttributeNode) {

if (form.getAttributeNode("id") &&
form.getAttributeNode("id").value) {

x = form.getAttributeNode("id").value;

} else {

x = form.getAttributeNode("name").value;

}

} else if (form.getAttribute) {

if (form.getAttribute("name")) {

x = form.getAttribute("name");

} else {

x =  form.getAttribute("id");

}

} else {

if (form.id) {

x =  form.id;

} else {

x =  form.name;

}

}

return x;

 }



This works in IE5.0.. don't know if it has caused any new
problems yet




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



Re: Validation in ie5

2006-01-05 Thread Kristian.L.Petersen
 

Hi, I changed the retrieveFormName method so it now lookes like this : 

 

function retrieveFormName(form) {

var x;

if (form.getAttributeNode) {

if (form.getAttributeNode("id") &&
form.getAttributeNode("id").value) {

x = form.getAttributeNode("id").value;

} else {

x = form.getAttributeNode("name").value;

}

} else if (form.getAttribute) {

if (form.getAttribute("name")) {

x = form.getAttribute("name");

} else {

x =  form.getAttribute("id");

}

} else {

if (form.id) {

x =  form.id;

} else {

x =  form.name;

}

}

return x;

 }

 

This works in IE5.0.. don't know if it has caused any new
problems yet



Re: Validation in ie5

2006-01-05 Thread Niall Pemberton
OK thx, I didn't notice the missing "return" - thats one bug then.

The only suggestion I can think of is to add a ";" in the eval expression
(after "mask()") - so something like...

replace..
   oMasked = eval('new ' + retrieveFormName(form) +  '_mask()');
with...
   oMasked = eval('new ' + retrieveFormName(form) +  '_mask();');

Whether that makes a difference in IE5 I'm only guessing in the dark.

Niall


- Original Message - 
From: <[EMAIL PROTECTED]>
To: 
Sent: Thursday, January 05, 2006 10:45 AM
Subject: Re: Validation in ie5


The diff is :

form.attributes["name"];

return form.attributes["name"];

Line 1361 is :

oMasked = eval('new ' + retrieveFormName(form) +  '_mask()');










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



Re: Validation in ie5

2006-01-05 Thread Kristian.L.Petersen
The diff is : 

form.attributes["name"];

return form.attributes["name"];

Line 1361 is : 

oMasked = eval('new ' + retrieveFormName(form) +  '_mask()');  

 

 

 



Re: Validation in ie5

2006-01-05 Thread Niall Pemberton
I can't see any difference between the two version of the retrieveFormName()
function you've pasted here.

Also can you find out whats on line 1361?

Niall

- Original Message - 
From: <[EMAIL PROTECTED]>
Sent: Thursday, January 05, 2006 9:41 AM


Hi, I have replaced :



function retrieveFormName(form) {

  if (form.getAttributeNode) {

  if (form.getAttributeNode("id") &&
form.getAttributeNode("id").value) {
  return form.getAttributeNode("id").value;
  } else {
  return form.getAttributeNode("name").value;
  }
  } else if (form.getAttribute) {

  if (form.getAttribute("id")) {

  return form.getAttribute("id");

  } else {

  form.attributes["name"];

  }

  } else {

  if (form.id) {

  return form.id;

  } else {

  return form.name;

  }

  }



  }





With



function retrieveFormName(form) {

if (form.getAttributeNode) {

if (form.getAttributeNode("id") &&

form.getAttributeNode("id").value) {

return form.getAttributeNode("id").value;

} else {

return form.getAttributeNode("name").value;

}

} else if (form.getAttribute) {

if (form.getAttribute("id")) {

return form.getAttribute("id");

} else {

return form.attributes["name"];

}

} else {

if (form.id) {

return form.id;

} else {

return form.name;

}

}

 }



But I still get the same error :



A Runtime error has occurred.
Do you wish to Debug ?
Line: 1361
Error: Expected ';'






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



Re: Validation in ie5

2006-01-05 Thread Kristian.L.Petersen
Hi, I have replaced :

 

function retrieveFormName(form) {

 

  // Please refer to Bugs 31534, 35127, 35294 & 37315

  // for the history of the following code

 

  if (form.getAttributeNode) {

  if (form.getAttributeNode("id") &&
form.getAttributeNode("id").value) {

  return form.getAttributeNode("id").value;

  } else {

  return form.getAttributeNode("name").value;

  }

  } else if (form.getAttribute) {

  if (form.getAttribute("id")) {

  return form.getAttribute("id");

  } else {

  form.attributes["name"];

  }

  } else {

  if (form.id) {

  return form.id;

  } else {

  return form.name;

  }

  }

 

  }  

 

 

With 

 

function retrieveFormName(form) {

if (form.getAttributeNode) {

if (form.getAttributeNode("id") &&

form.getAttributeNode("id").value) {

return form.getAttributeNode("id").value;

} else {

return form.getAttributeNode("name").value;

}

} else if (form.getAttribute) {

if (form.getAttribute("id")) {

return form.getAttribute("id");

} else {

return form.attributes["name"];

}

} else {

if (form.id) {

return form.id;

} else {

return form.name;

}

}

 }

 

But I still get the same error : 

 

A Runtime error has occurred.
Do you wish to Debug ?
Line: 1361
Error: Expected ';'

 



Re: Validation in ie5

2006-01-05 Thread Niall Pemberton
Kristian,

Could you please reply to the mailing lists rather than me directly, thx.

I applied a patch to Commons Validator 1.2.0 which resolved an IE5.5
issue

http://issues.apache.org/bugzilla/show_bug.cgi?id=37315

...and I was hoping that would resolve your issue.

The second error you mention looks like a similar problem - it doesn't seem
able to retrieve the name/id of the form bean - I'm guessing that by the
fact you say your getting 'undefined_mask' - looks like its returning
"undefined" instead of the form bean name.

One thing we did in Commons Validator 1.2.0 was refactor the logic to get
the form bean name to a common javascript function in the
validateUtilities.js script. What you could do is create a custom version of
the validateUtilities.js script that works for you in IE5 and then configure
struts to use your custom script (in the validator-rules.xml) rather than
the standard one shipped in the commons validator jar.

Unfortunately I do not have a copy of IE5, so I can't reproduce your error
and try/test solutions to it - so either yourself or someone else will need
to come up with something to resolve this. The first step is to debug the
javascript and find out exactly what is going wrong.

Niall

- Original Message - 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 05, 2006 8:33 AM
Subject: Re: Validation in ie5


I am using struts 1.2.7, and I have tryied with the commons-validator
1.2.0, but that didn't help.

When I use ie5 and i.e try to submit a form where some client validation
is done I get errors in a popup like...

A Runtime error has occurred.
Do you wish to Debug ?
Line: 1361
Error: Expected ';'

Or

A Runtime error has occurred.
Do you wish to Debug ?
Line: 1360
Error: 'undifined_mask' is undefined























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



Re: Validation in ie5

2006-01-04 Thread Niall Pemberton
Saying "it doesn't work in ie5" doesn't really help alot - I don't have a
copy of ie5, so if you could specify the issue then it would be helpful.
Also what version of 1) Struts and 2) Commons Validator are you using? Can
you try upgrading to Commons Validator 1.2.0 and see if the issue still
occurs. Even if there is still a problem in Validator 1.2.0, depending on
the issue, there might be an easy workaround since there has been some
refactoring of the JavaScript in that version.

Niall

- Original Message - 
From: "Ted Husted" <[EMAIL PROTECTED]>
Sent: Wednesday, January 04, 2006 1:49 PM


The Action  framework doesn't support browser detection
out-oif-the-box. But, you could check the HTTP request flags from the
Action to determine the browser, and then forward to another version
of the page that didn't use client-side validation or used custom
validation.

You might want to report the ie6 issue to the Commons Validator team.

* http://jakarta.apache.org/commons/validator/issue-tracking.html

-- HTH, Ted.
http://www.husted.com/poe/

On 1/2/06, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> Hi, I am using the struts client site validation.
>
> Usually the users will use ie6, but some must use ie5 and here the
> validation doesn't work.
>
> Can anyone tell me how I can fix that, either by disable the validation
> if the user uses ie5 or some other solution



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



Re: Validation in ie5

2006-01-04 Thread Ted Husted
The Action  framework doesn't support browser detection
out-oif-the-box. But, you could check the HTTP request flags from the
Action to determine the browser, and then forward to another version
of the page that didn't use client-side validation or used custom
validation.

You might want to report the ie6 issue to the Commons Validator team.

* http://jakarta.apache.org/commons/validator/issue-tracking.html

-- HTH, Ted.
http://www.husted.com/poe/

On 1/2/06, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> Hi, I am using the struts client site validation.
>
> Usually the users will use ie6, but some must use ie5 and here the
> validation doesn't work.
>
> Can anyone tell me how I can fix that, either by disable the validation
> if the user uses ie5 or some other solution

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



Re: validation plug-in with multiple config files

2005-12-21 Thread Laurie Harper

Christopher Becker wrote:

I am developing a Struts (v1.2.7) app that has multiple struts-config
files, but not utilizing modules, so web.xml has one init param with
config files separated by commas, eg.
 


  config
 
/WEB-INF/struts-config.xml,/WEB-INF/struts-bus1-config.xml,

WEB-INF/struts-bus2-config.xml

 
My question involves the validator plug-in entry in the config files.

Does the plugin entry need to be added to all config files, or just the
default one? 


Just the default one. When you use multiple config files this way, 
they're effectively concatenated.


L.


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



Re: validation javascripts

2005-12-15 Thread Deepa Khetan
ya.. i agree with you Raghu!! I would want minlength validation to work
before mask is applied.. But the order in which the validations are
specified do not affect the order in which they are applied. I have tried
that out.

On 12/15/05, Raghu Kanchustambham <[EMAIL PROTECTED]> wrote:
>
> >> I'm not sure it matters much which order they're applied in, though,
> since all have to pass
> >> anyway.
>
> Order does matter... That will decide which *one* of the error messages to
> display to the user when one of these tests fail.
>
>
>
> On 12/15/05, Laurie Harper <[EMAIL PROTECTED]> wrote:
> >
> > Deepa Khetan wrote:
> > > Is there a way to specify the order of validaions to occur using
> > > validation.xml?? I have noticed that "mask" take precedence over
> > "minlength"
> >
> > I'm not sure; maybe the order they're listed will affect the order
> > they're applied? I'm not sure it matters much which order they're
> > applied in, though, since all have to pass anyway.
> >
> > L.
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>


Re: validation javascripts

2005-12-15 Thread Raghu Kanchustambham
>> I'm not sure it matters much which order they're applied in, though,
since all have to pass
>> anyway.

Order does matter... That will decide which *one* of the error messages to
display to the user when one of these tests fail.



On 12/15/05, Laurie Harper <[EMAIL PROTECTED]> wrote:
>
> Deepa Khetan wrote:
> > Is there a way to specify the order of validaions to occur using
> > validation.xml?? I have noticed that "mask" take precedence over
> "minlength"
>
> I'm not sure; maybe the order they're listed will affect the order
> they're applied? I'm not sure it matters much which order they're
> applied in, though, since all have to pass anyway.
>
> L.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: validation javascripts

2005-12-14 Thread Laurie Harper

Deepa Khetan wrote:

Is there a way to specify the order of validaions to occur using
validation.xml?? I have noticed that "mask" take precedence over "minlength"


I'm not sure; maybe the order they're listed will affect the order 
they're applied? I'm not sure it matters much which order they're 
applied in, though, since all have to pass anyway.


L.


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



Re: validation javascripts

2005-12-12 Thread Deepa Khetan
Is there a way to specify the order of validaions to occur using
validation.xml?? I have noticed that "mask" take precedence over "minlength"




On 12/13/05, Laurie Harper <[EMAIL PROTECTED]> wrote:
>
> Bahadır Yağan wrote:
> > Hi,
> >
> > Is there a way to change the behavior of the validation plug-in, to
> > print the errors inside the page rather than showing them in a message
> box.
>
> You can place server-side validation errors anywhere in the page you
> like, but there's currently no way to control how client-side
> validations are shown; the Javascript alert is the only option.
>
> You would need to hack on the validator Javascript to do anything
> different.
>
> L.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: validation javascripts

2005-12-12 Thread Laurie Harper

Bahadır Yağan wrote:

Hi,

Is there a way to change the behavior of the validation plug-in, to 
print the errors inside the page rather than showing them in a message box.


You can place server-side validation errors anywhere in the page you 
like, but there's currently no way to control how client-side 
validations are shown; the Javascript alert is the only option.


You would need to hack on the validator Javascript to do anything different.

L.


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



Re: Validation without using a DynaValidatorForm

2005-11-16 Thread Jesus Salvo Jr.
On Thursday 17 November 2005 13:24, Wendy Smoak wrote:
> On 11/16/05, Jesus Salvo Jr. <[EMAIL PROTECTED]> wrote:
> > Struts 1.2.7
> >
> > What I am confused about is that validation via the validation.xml seems
> > only to work ( or so I believe after reading various documentations and
> > samples ) if one uses DynaValidatorForm instead of an ActionForm.
>
> I haven't used it, but there is a "plain" ValidatorForm:
> http://struts.apache.org/struts-core/apidocs/org/apache/struts/validator/Va
>lidatorForm.html
>
> Would that work for you?
>

Yes. I have extended the form bean to use ValidatorForm.

What was missing in all my search was the you have to specify the input 
attribute on the action element. The value of the input attribute is a URI to 
forward to if validation fails.

Thanks.

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



Re: Validation without using a DynaValidatorForm

2005-11-16 Thread Wendy Smoak
On 11/16/05, Jesus Salvo Jr. <[EMAIL PROTECTED]> wrote:

> Struts 1.2.7
>
> What I am confused about is that validation via the validation.xml seems only
> to work ( or so I believe after reading various documentations and samples )
> if one uses DynaValidatorForm instead of an ActionForm.

I haven't used it, but there is a "plain" ValidatorForm:
http://struts.apache.org/struts-core/apidocs/org/apache/struts/validator/ValidatorForm.html

Would that work for you?

--
Wendy

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



RE: Validation seemingly not getting called any longer

2005-11-09 Thread David G. Friedman
I think I found the explanation from Corey Probst back in March (11th, 2005)
on this list:

__ By adding a comma separated list of struts config
__ files, you are not specifying multiple *modules*,
__ just multiple config files.  ValidatorResources
__ are stored in the ServletContext after being read

** BINGO (that's my comment on the above) ***

__ by the plugin.  So, when struts-config-two is
__ read, it overwrites the info stored for
__ struts-config-one.
__
__ To specify multiple modules you need to declare in the
__ ActionServlet init params something like this...
__ 
__config
__/WEB-INF/struts-config-one.xml
__ 
__ 
__config/module1
__/WEB-INF/struts-config-two.xml
__ 
__
__ Corey

The thread on one site archiving our struts-user list starts here:
http://marc.theaimsgroup.com/?l=struts-user&m=111056535028708&w=2

Regards,
David

-Original Message-
From: Preston CRAWFORD [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 09, 2005 1:46 PM
To: user@struts.apache.org
Subject: RE: Validation seemingly not getting called any longer


That would be nice. Wouldn't be a bad thing to add, either.

Preston

>>> [EMAIL PROTECTED] 11/8/2005 7:54 PM >>>
Preston,

It is great to hear you've identified your problem.  I'd just been
looking
over my examples and couldn't find anything out of place with the
code/xml/config samples you'd included.

Now, about your multiple module problems, I tried to find an old link
to the
(wiki?/faq?) page listing things to watch out for when you use modules
or
multiple struts-config.xml files but I can't find it.  Perhaps someone
else
can send you that link so you'll know what else to watch out for when
using
multiple (or module based) struts-config.xml files.

Regards,
David

-Original Message-
From: Preston CRAWFORD [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 08, 2005 9:27 PM
To: user@struts.apache.org
Subject: RE: Validation seemingly not getting called any longer


Solved it. Weird.

I rolled back to an old version to try to figure out what was
different. And the 1 thing that was different is that I'd created a
second struts config and second validation. So my web.xml turned into
this..

ourproject

org.apache.struts.action.ActionServlet

config

/WEB-INF/struts-config.xml,
/WEB-INF/subproject/struts-config.xml,



And within that other struts-config.xml I had this


   


Apparently that was the wrong way to go about it, because the second
validator plugin call overrides the first.

Lesson learned.

Preston


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



RE: Validation seemingly not getting called any longer

2005-11-09 Thread Preston CRAWFORD
That would be nice. Wouldn't be a bad thing to add, either.

Preston

>>> [EMAIL PROTECTED] 11/8/2005 7:54 PM >>>
Preston,

It is great to hear you've identified your problem.  I'd just been
looking
over my examples and couldn't find anything out of place with the
code/xml/config samples you'd included.

Now, about your multiple module problems, I tried to find an old link
to the
(wiki?/faq?) page listing things to watch out for when you use modules
or
multiple struts-config.xml files but I can't find it.  Perhaps someone
else
can send you that link so you'll know what else to watch out for when
using
multiple (or module based) struts-config.xml files.

Regards,
David

-Original Message-
From: Preston CRAWFORD [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 08, 2005 9:27 PM
To: user@struts.apache.org 
Subject: RE: Validation seemingly not getting called any longer


Solved it. Weird.

I rolled back to an old version to try to figure out what was
different. And the 1 thing that was different is that I'd created a
second struts config and second validation. So my web.xml turned into
this..

ourproject

org.apache.struts.action.ActionServlet

config

/WEB-INF/struts-config.xml,
/WEB-INF/subproject/struts-config.xml,



And within that other struts-config.xml I had this


   


Apparently that was the wrong way to go about it, because the second
validator plugin call overrides the first.

Lesson learned.

Preston

>>> [EMAIL PROTECTED] 11/8/2005 5:07 PM >>>
Thanks for the help everyone.

David,

As far as the issue of timing, users, etc. this is a site in
development. So about 4 developers are working continuously on the
site
and so it's definitely something that happened as a result of a change
by another developer, but I can't put my finger on what it is. I don't
know when it occurred. It just doesn't validate right now. All jars
are
the same.

loginForm extends the ValidatorForm.

What else? I found the place where seemingly my one rule (I commented
the others out) gets loaded for the form...

DEBUG [main] (ValidatorResources.java:192) - Adding FormSet 'FormSet:
language=n
ull  country=null  variant=null
   Form: loginForm
Field:
key = username
property = username
indexedProperty = null
indexedListProperty = null
depends = required
page = 0
fieldOrder = 0
Vars:

Does that look right? This is what sets it up.

validation.xml








struts-config.xml


and later...






So I don't know what to do at this point. It all seems to be setup
right.

Preston

>>> [EMAIL PROTECTED] 11/8/2005 4:21 PM >>>
Preston,

1. Did the problem occur after a web application server (Jetty,
Tomcat,
JBoss, etc.) shutdown/startup cycle or while the application was
running
uninterrupted?

2. Have you changed ANY jar files in the webapp or any class files?
Anything which could have caused a spontaneous webapp reload?  The log
files
in your container should indicate a shutdown/restart.

3. I see your action is listed (in a previous post) as with the form
name
"loginForm".  Does that form extend ValidatorActionForm?  And what is
your
struts-config.xml form-bean definition?

4. Are there any other developers for this site?

5. What are the file datestamps/timestamps on teh web.xml,
struts-config.xml, validation.xml, validator-rules.xml, etc.  Are they
recent (as in someone might have modified them before the last webapp
restart) or dated months ago (indicating no recent changes) ?

Regards,
David

-Original Message-----
From: Preston CRAWFORD [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 08, 2005 7:05 PM
To: user@struts.apache.org 
Subject: Re: Validation seemingly not getting called any longer


It's not configured in Validation.xml. The form is









mask
^[0-9a-zA-Z]*$




I did turn up debugging on log4j.logger.org.apache.commons.validator
and log4j.logger.org.apache.struts and the interesting thing is that I
don't see the form validation getting built or initialized. What would
that look like? I wonder why that would not be occurring.

Preston

>>> [EMAIL PROTECTED] 11/8/2005 3:23 PM >>>
On 11/8/05, Preston CRAWFORD <[EMAIL PROTECTED]> wrote:
> I have that. Either way the bottom line for me is it flys past
> validation, message or no message. So I need to figure out why that
is
> happening.

What _type_ of Actio

RE: Validation seemingly not getting called any longer

2005-11-09 Thread Garner, Shawn
Got me then.  Start from scratch rebuild everything.
Maybe your web server doesn't have the right war on it or something like
that.

Shawn D. Garner

-Original Message-
From: Preston CRAWFORD [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 08, 2005 5:08 PM
To: user@struts.apache.org
Subject: RE: Validation seemingly not getting called any longer

Yeah, that's there. Like I said, it was working earlier. Not sure why
it's not now.

Preston

>>> [EMAIL PROTECTED] 11/8/2005 2:41 PM >>>
Do you have the commons-validator jar in your WEB-INF/lib directory of
your
web application?

Might be other jars you need to but I know you need this one for sure.


Shawn D. Garner

-Original Message-
From: Garner, Shawn 
Sent: Tuesday, November 08, 2005 4:23 PM
To: 'Struts Users Mailing List'
Subject: RE: Validation seemingly not getting called any longer

I think you might need the following in your jsp page:


Shawn D. Garner
-Original Message-
From: Martin Gainty [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 08, 2005 12:39 PM
To: Struts Users Mailing List
Subject: Re: Validation seemingly not getting called any longer

yes
validation.xml and
validator-rules.xml
are both configured as properties via plug-in in struts-config.xml
http://www.oracle.com/technology/oramag/oracle/04-jan/o14dev_struts.html

HTH,
Martin-
- Original Message - 
From: "Garner, Shawn" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" 
Sent: Tuesday, November 08, 2005 1:08 PM
Subject: RE: Validation seemingly not getting called any longer


>I think you need something in the struts config file telling it to use
the
> validation plugin. Try that line of investigation.
> Not sure off the top of my head.
>
> Shawn D. Garner
>
> -Original Message-
> From: Preston CRAWFORD [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, November 08, 2005 11:39 AM
> To: user@struts.apache.org 
> Subject: Validation seemingly not getting called any longer
>
> We have a simple login form. By the book. For some reason all of a
> sudden the validation in validation.xml is no longer getting called.
> We
> have validate set to true in the action. Everything is still named
the
> same. Any idea why this would have changed or where to start
looking?
>
> Preston
>
>
-
> To unsubscribe, e-mail: [EMAIL PROTECTED] 
> For additional commands, e-mail: [EMAIL PROTECTED] 
>
>

> This email may contain confidential material.
> If you were not an intended recipient,
> Please notify the sender and delete all copies.
> We may monitor email to and from our network.
>

>
>
-
> 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] 



This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 


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



This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 


-
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]

 
This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 


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



RE: Validation seemingly not getting called any longer

2005-11-08 Thread David G. Friedman
Preston,

It is great to hear you've identified your problem.  I'd just been looking
over my examples and couldn't find anything out of place with the
code/xml/config samples you'd included.

Now, about your multiple module problems, I tried to find an old link to the
(wiki?/faq?) page listing things to watch out for when you use modules or
multiple struts-config.xml files but I can't find it.  Perhaps someone else
can send you that link so you'll know what else to watch out for when using
multiple (or module based) struts-config.xml files.

Regards,
David

-Original Message-
From: Preston CRAWFORD [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 08, 2005 9:27 PM
To: user@struts.apache.org
Subject: RE: Validation seemingly not getting called any longer


Solved it. Weird.

I rolled back to an old version to try to figure out what was
different. And the 1 thing that was different is that I'd created a
second struts config and second validation. So my web.xml turned into
this..

ourproject

org.apache.struts.action.ActionServlet

config

/WEB-INF/struts-config.xml,
/WEB-INF/subproject/struts-config.xml,



And within that other struts-config.xml I had this


   


Apparently that was the wrong way to go about it, because the second
validator plugin call overrides the first.

Lesson learned.

Preston

>>> [EMAIL PROTECTED] 11/8/2005 5:07 PM >>>
Thanks for the help everyone.

David,

As far as the issue of timing, users, etc. this is a site in
development. So about 4 developers are working continuously on the
site
and so it's definitely something that happened as a result of a change
by another developer, but I can't put my finger on what it is. I don't
know when it occurred. It just doesn't validate right now. All jars
are
the same.

loginForm extends the ValidatorForm.

What else? I found the place where seemingly my one rule (I commented
the others out) gets loaded for the form...

DEBUG [main] (ValidatorResources.java:192) - Adding FormSet 'FormSet:
language=n
ull  country=null  variant=null
   Form: loginForm
Field:
key = username
property = username
indexedProperty = null
indexedListProperty = null
depends = required
page = 0
fieldOrder = 0
Vars:

Does that look right? This is what sets it up.

validation.xml








struts-config.xml


and later...






So I don't know what to do at this point. It all seems to be setup
right.

Preston

>>> [EMAIL PROTECTED] 11/8/2005 4:21 PM >>>
Preston,

1. Did the problem occur after a web application server (Jetty,
Tomcat,
JBoss, etc.) shutdown/startup cycle or while the application was
running
uninterrupted?

2. Have you changed ANY jar files in the webapp or any class files?
Anything which could have caused a spontaneous webapp reload?  The log
files
in your container should indicate a shutdown/restart.

3. I see your action is listed (in a previous post) as with the form
name
"loginForm".  Does that form extend ValidatorActionForm?  And what is
your
struts-config.xml form-bean definition?

4. Are there any other developers for this site?

5. What are the file datestamps/timestamps on teh web.xml,
struts-config.xml, validation.xml, validator-rules.xml, etc.  Are they
recent (as in someone might have modified them before the last webapp
restart) or dated months ago (indicating no recent changes) ?

Regards,
David

-Original Message-
From: Preston CRAWFORD [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 08, 2005 7:05 PM
To: user@struts.apache.org
Subject: Re: Validation seemingly not getting called any longer


It's not configured in Validation.xml. The form is









mask
^[0-9a-zA-Z]*$




I did turn up debugging on log4j.logger.org.apache.commons.validator
and log4j.logger.org.apache.struts and the interesting thing is that I
don't see the form validation getting built or initialized. What would
that look like? I wonder why that would not be occurring.

Preston

>>> [EMAIL PROTECTED] 11/8/2005 3:23 PM >>>
On 11/8/05, Preston CRAWFORD <[EMAIL PROTECTED]> wrote:
> I have that. Either way the bottom line for me is it flys past
> validation, message or no message. So I need to figure out why that
is
> happening.

What _type_ of Action is LoginSubmitAction and How is it configured in
validation.xml?

What's in the log files at application startup?  Turn logging up to


RE: Validation seemingly not getting called any longer

2005-11-08 Thread Preston CRAWFORD
Solved it. Weird.

I rolled back to an old version to try to figure out what was
different. And the 1 thing that was different is that I'd created a
second struts config and second validation. So my web.xml turned into
this..

ourproject
   
org.apache.struts.action.ActionServlet

config

/WEB-INF/struts-config.xml,
/WEB-INF/subproject/struts-config.xml,



And within that other struts-config.xml I had this


   


Apparently that was the wrong way to go about it, because the second
validator plugin call overrides the first.

Lesson learned.

Preston

>>> [EMAIL PROTECTED] 11/8/2005 5:07 PM >>>
Thanks for the help everyone. 

David,

As far as the issue of timing, users, etc. this is a site in
development. So about 4 developers are working continuously on the
site
and so it's definitely something that happened as a result of a change
by another developer, but I can't put my finger on what it is. I don't
know when it occurred. It just doesn't validate right now. All jars
are
the same. 

loginForm extends the ValidatorForm. 

What else? I found the place where seemingly my one rule (I commented
the others out) gets loaded for the form...

DEBUG [main] (ValidatorResources.java:192) - Adding FormSet 'FormSet:
language=n
ull  country=null  variant=null
   Form: loginForm
Field:
key = username
property = username
indexedProperty = null
indexedListProperty = null
depends = required
page = 0
fieldOrder = 0
Vars:

Does that look right? This is what sets it up.

validation.xml








struts-config.xml


and later...






So I don't know what to do at this point. It all seems to be setup
right.

Preston

>>> [EMAIL PROTECTED] 11/8/2005 4:21 PM >>>
Preston,

1. Did the problem occur after a web application server (Jetty,
Tomcat,
JBoss, etc.) shutdown/startup cycle or while the application was
running
uninterrupted?

2. Have you changed ANY jar files in the webapp or any class files?
Anything which could have caused a spontaneous webapp reload?  The log
files
in your container should indicate a shutdown/restart.

3. I see your action is listed (in a previous post) as with the form
name
"loginForm".  Does that form extend ValidatorActionForm?  And what is
your
struts-config.xml form-bean definition?

4. Are there any other developers for this site?

5. What are the file datestamps/timestamps on teh web.xml,
struts-config.xml, validation.xml, validator-rules.xml, etc.  Are they
recent (as in someone might have modified them before the last webapp
restart) or dated months ago (indicating no recent changes) ?

Regards,
David

-Original Message-
From: Preston CRAWFORD [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 08, 2005 7:05 PM
To: user@struts.apache.org 
Subject: Re: Validation seemingly not getting called any longer


It's not configured in Validation.xml. The form is









mask
^[0-9a-zA-Z]*$




I did turn up debugging on log4j.logger.org.apache.commons.validator
and log4j.logger.org.apache.struts and the interesting thing is that I
don't see the form validation getting built or initialized. What would
that look like? I wonder why that would not be occurring.

Preston

>>> [EMAIL PROTECTED] 11/8/2005 3:23 PM >>>
On 11/8/05, Preston CRAWFORD <[EMAIL PROTECTED]> wrote:
> I have that. Either way the bottom line for me is it flys past
> validation, message or no message. So I need to figure out why that
is
> happening.

What _type_ of Action is LoginSubmitAction and How is it configured in
validation.xml?

What's in the log files at application startup?  Turn logging up to
'debug' and you should see the validation config files being used to
configure validation for each form.

If the config looks right and there's nothing interesting in the log
files, try stepping through the code in a debugger.  JSwat is my
favorite, though I'm still getting used to the new version (and need
to update the instructions...)

--
Wendy
http://wiki.wsmoak.net/cgi-bin/wiki.pl?TomcatDebug 

-
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 Question how to echo back users input in error message?

2005-11-08 Thread Niall Pemberton
Not from the request - from the form bean (or indexed Bean) - in this
example lineNumber needs to be a property of the indexed bean.

Niall

- Original Message - 
From: "Michael Jouravlev" <[EMAIL PROTECTED]>
Sent: Wednesday, November 09, 2005 12:47 AM


On 11/8/05, Niall Pemberton <[EMAIL PROTECTED]> wrote:
> The short answer is that there isn't a way to echo back user input in the
> error message.
...
> There are two places that I know of, where this kind of functionality has
> been provided. The first is in the "extends validator" I wrote (see the
> "indexed example"):
>
>http://www.niallp.pwp.blueyonder.co.uk/strutsvalidatorextends.html


  
extendsItems
  
  


Are you saying that it will take a real lineNumber from request? How
does it know to get if from request? Does it just checks if request
has this key, and if not, goes to the property file?

Michael.

-
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 seemingly not getting called any longer

2005-11-08 Thread Preston CRAWFORD
Thanks for the help everyone. 

David,

As far as the issue of timing, users, etc. this is a site in
development. So about 4 developers are working continuously on the site
and so it's definitely something that happened as a result of a change
by another developer, but I can't put my finger on what it is. I don't
know when it occurred. It just doesn't validate right now. All jars are
the same. 

loginForm extends the ValidatorForm. 

What else? I found the place where seemingly my one rule (I commented
the others out) gets loaded for the form...

DEBUG [main] (ValidatorResources.java:192) - Adding FormSet 'FormSet:
language=n
ull  country=null  variant=null
   Form: loginForm
Field:
key = username
property = username
indexedProperty = null
indexedListProperty = null
depends = required
page = 0
fieldOrder = 0
Vars:

Does that look right? This is what sets it up.

validation.xml








struts-config.xml


and later...






So I don't know what to do at this point. It all seems to be setup
right.

Preston

>>> [EMAIL PROTECTED] 11/8/2005 4:21 PM >>>
Preston,

1. Did the problem occur after a web application server (Jetty,
Tomcat,
JBoss, etc.) shutdown/startup cycle or while the application was
running
uninterrupted?

2. Have you changed ANY jar files in the webapp or any class files?
Anything which could have caused a spontaneous webapp reload?  The log
files
in your container should indicate a shutdown/restart.

3. I see your action is listed (in a previous post) as with the form
name
"loginForm".  Does that form extend ValidatorActionForm?  And what is
your
struts-config.xml form-bean definition?

4. Are there any other developers for this site?

5. What are the file datestamps/timestamps on teh web.xml,
struts-config.xml, validation.xml, validator-rules.xml, etc.  Are they
recent (as in someone might have modified them before the last webapp
restart) or dated months ago (indicating no recent changes) ?

Regards,
David

-Original Message-
From: Preston CRAWFORD [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 08, 2005 7:05 PM
To: user@struts.apache.org 
Subject: Re: Validation seemingly not getting called any longer


It's not configured in Validation.xml. The form is









mask
^[0-9a-zA-Z]*$




I did turn up debugging on log4j.logger.org.apache.commons.validator
and log4j.logger.org.apache.struts and the interesting thing is that I
don't see the form validation getting built or initialized. What would
that look like? I wonder why that would not be occurring.

Preston

>>> [EMAIL PROTECTED] 11/8/2005 3:23 PM >>>
On 11/8/05, Preston CRAWFORD <[EMAIL PROTECTED]> wrote:
> I have that. Either way the bottom line for me is it flys past
> validation, message or no message. So I need to figure out why that
is
> happening.

What _type_ of Action is LoginSubmitAction and How is it configured in
validation.xml?

What's in the log files at application startup?  Turn logging up to
'debug' and you should see the validation config files being used to
configure validation for each form.

If the config looks right and there's nothing interesting in the log
files, try stepping through the code in a debugger.  JSwat is my
favorite, though I'm still getting used to the new version (and need
to update the instructions...)

--
Wendy
http://wiki.wsmoak.net/cgi-bin/wiki.pl?TomcatDebug 

-
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] 


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



Re: Validation Question how to echo back users input in error message?

2005-11-08 Thread Michael Jouravlev
On 11/8/05, Niall Pemberton <[EMAIL PROTECTED]> wrote:
> The short answer is that there isn't a way to echo back user input in the
> error message.
...
> There are two places that I know of, where this kind of functionality has
> been provided. The first is in the "extends validator" I wrote (see the
> "indexed example"):
>
>http://www.niallp.pwp.blueyonder.co.uk/strutsvalidatorextends.html


  
extendsItems
  
  


Are you saying that it will take a real lineNumber from request? How
does it know to get if from request? Does it just checks if request
has this key, and if not, goes to the property file?

Michael.

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



RE: Validation seemingly not getting called any longer

2005-11-08 Thread David G. Friedman
Preston,

1. Did the problem occur after a web application server (Jetty, Tomcat,
JBoss, etc.) shutdown/startup cycle or while the application was running
uninterrupted?

2. Have you changed ANY jar files in the webapp or any class files?
Anything which could have caused a spontaneous webapp reload?  The log files
in your container should indicate a shutdown/restart.

3. I see your action is listed (in a previous post) as with the form name
"loginForm".  Does that form extend ValidatorActionForm?  And what is your
struts-config.xml form-bean definition?

4. Are there any other developers for this site?

5. What are the file datestamps/timestamps on teh web.xml,
struts-config.xml, validation.xml, validator-rules.xml, etc.  Are they
recent (as in someone might have modified them before the last webapp
restart) or dated months ago (indicating no recent changes) ?

Regards,
David

-Original Message-
From: Preston CRAWFORD [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 08, 2005 7:05 PM
To: user@struts.apache.org
Subject: Re: Validation seemingly not getting called any longer


It's not configured in Validation.xml. The form is









mask
^[0-9a-zA-Z]*$




I did turn up debugging on log4j.logger.org.apache.commons.validator
and log4j.logger.org.apache.struts and the interesting thing is that I
don't see the form validation getting built or initialized. What would
that look like? I wonder why that would not be occurring.

Preston

>>> [EMAIL PROTECTED] 11/8/2005 3:23 PM >>>
On 11/8/05, Preston CRAWFORD <[EMAIL PROTECTED]> wrote:
> I have that. Either way the bottom line for me is it flys past
> validation, message or no message. So I need to figure out why that
is
> happening.

What _type_ of Action is LoginSubmitAction and How is it configured in
validation.xml?

What's in the log files at application startup?  Turn logging up to
'debug' and you should see the validation config files being used to
configure validation for each form.

If the config looks right and there's nothing interesting in the log
files, try stepping through the code in a debugger.  JSwat is my
favorite, though I'm still getting used to the new version (and need
to update the instructions...)

--
Wendy
http://wiki.wsmoak.net/cgi-bin/wiki.pl?TomcatDebug

-
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 seemingly not getting called any longer

2005-11-08 Thread Preston CRAWFORD
It's not configured in Validation.xml. The form is









mask
^[0-9a-zA-Z]*$




I did turn up debugging on log4j.logger.org.apache.commons.validator
and log4j.logger.org.apache.struts and the interesting thing is that I
don't see the form validation getting built or initialized. What would
that look like? I wonder why that would not be occurring.

Preston

>>> [EMAIL PROTECTED] 11/8/2005 3:23 PM >>>
On 11/8/05, Preston CRAWFORD <[EMAIL PROTECTED]> wrote:
> I have that. Either way the bottom line for me is it flys past
> validation, message or no message. So I need to figure out why that
is
> happening.

What _type_ of Action is LoginSubmitAction and How is it configured in
validation.xml?

What's in the log files at application startup?  Turn logging up to
'debug' and you should see the validation config files being used to
configure validation for each form.

If the config looks right and there's nothing interesting in the log
files, try stepping through the code in a debugger.  JSwat is my
favorite, though I'm still getting used to the new version (and need
to update the instructions...)

--
Wendy
http://wiki.wsmoak.net/cgi-bin/wiki.pl?TomcatDebug 

-
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 seemingly not getting called any longer

2005-11-08 Thread Wendy Smoak
On 11/8/05, Preston CRAWFORD <[EMAIL PROTECTED]> wrote:
> I have that. Either way the bottom line for me is it flys past
> validation, message or no message. So I need to figure out why that is
> happening.

What _type_ of Action is LoginSubmitAction and How is it configured in
validation.xml?

What's in the log files at application startup?  Turn logging up to
'debug' and you should see the validation config files being used to
configure validation for each form.

If the config looks right and there's nothing interesting in the log
files, try stepping through the code in a debugger.  JSwat is my
favorite, though I'm still getting used to the new version (and need
to update the instructions...)

--
Wendy
http://wiki.wsmoak.net/cgi-bin/wiki.pl?TomcatDebug

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



RE: Validation seemingly not getting called any longer

2005-11-08 Thread Preston CRAWFORD
Yeah, that's there. Like I said, it was working earlier. Not sure why
it's not now.

Preston

>>> [EMAIL PROTECTED] 11/8/2005 2:41 PM >>>
Do you have the commons-validator jar in your WEB-INF/lib directory of
your
web application?

Might be other jars you need to but I know you need this one for sure.


Shawn D. Garner

-Original Message-
From: Garner, Shawn 
Sent: Tuesday, November 08, 2005 4:23 PM
To: 'Struts Users Mailing List'
Subject: RE: Validation seemingly not getting called any longer

I think you might need the following in your jsp page:


Shawn D. Garner
-Original Message-
From: Martin Gainty [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 08, 2005 12:39 PM
To: Struts Users Mailing List
Subject: Re: Validation seemingly not getting called any longer

yes
validation.xml and
validator-rules.xml
are both configured as properties via plug-in in struts-config.xml
http://www.oracle.com/technology/oramag/oracle/04-jan/o14dev_struts.html

HTH,
Martin-
- Original Message - 
From: "Garner, Shawn" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" 
Sent: Tuesday, November 08, 2005 1:08 PM
Subject: RE: Validation seemingly not getting called any longer


>I think you need something in the struts config file telling it to use
the
> validation plugin. Try that line of investigation.
> Not sure off the top of my head.
>
> Shawn D. Garner
>
> -Original Message-
> From: Preston CRAWFORD [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, November 08, 2005 11:39 AM
> To: user@struts.apache.org 
> Subject: Validation seemingly not getting called any longer
>
> We have a simple login form. By the book. For some reason all of a
> sudden the validation in validation.xml is no longer getting called.
> We
> have validate set to true in the action. Everything is still named
the
> same. Any idea why this would have changed or where to start
looking?
>
> Preston
>
>
-
> To unsubscribe, e-mail: [EMAIL PROTECTED] 
> For additional commands, e-mail: [EMAIL PROTECTED] 
>
>

> This email may contain confidential material.
> If you were not an intended recipient,
> Please notify the sender and delete all copies.
> We may monitor email to and from our network.
>

>
>
-
> 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] 



This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 


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



This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 


-
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 seemingly not getting called any longer

2005-11-08 Thread Garner, Shawn
Do you have the commons-validator jar in your WEB-INF/lib directory of your
web application?

Might be other jars you need to but I know you need this one for sure.


Shawn D. Garner

-Original Message-
From: Garner, Shawn 
Sent: Tuesday, November 08, 2005 4:23 PM
To: 'Struts Users Mailing List'
Subject: RE: Validation seemingly not getting called any longer

I think you might need the following in your jsp page:


Shawn D. Garner
-Original Message-
From: Martin Gainty [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 08, 2005 12:39 PM
To: Struts Users Mailing List
Subject: Re: Validation seemingly not getting called any longer

yes
validation.xml and
validator-rules.xml
are both configured as properties via plug-in in struts-config.xml
http://www.oracle.com/technology/oramag/oracle/04-jan/o14dev_struts.html
HTH,
Martin-
- Original Message - 
From: "Garner, Shawn" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" 
Sent: Tuesday, November 08, 2005 1:08 PM
Subject: RE: Validation seemingly not getting called any longer


>I think you need something in the struts config file telling it to use the
> validation plugin. Try that line of investigation.
> Not sure off the top of my head.
>
> Shawn D. Garner
>
> -Original Message-
> From: Preston CRAWFORD [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, November 08, 2005 11:39 AM
> To: user@struts.apache.org
> Subject: Validation seemingly not getting called any longer
>
> We have a simple login form. By the book. For some reason all of a
> sudden the validation in validation.xml is no longer getting called.
> We
> have validate set to true in the action. Everything is still named the
> same. Any idea why this would have changed or where to start looking?
>
> Preston
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

> This email may contain confidential material.
> If you were not an intended recipient,
> Please notify the sender and delete all copies.
> We may monitor email to and from our network.
>

>
> -
> 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]



This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 


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

 
This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 


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



RE: Validation seemingly not getting called any longer

2005-11-08 Thread Garner, Shawn
I think you might need the following in your jsp page:


Shawn D. Garner
-Original Message-
From: Martin Gainty [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 08, 2005 12:39 PM
To: Struts Users Mailing List
Subject: Re: Validation seemingly not getting called any longer

yes
validation.xml and
validator-rules.xml
are both configured as properties via plug-in in struts-config.xml
http://www.oracle.com/technology/oramag/oracle/04-jan/o14dev_struts.html
HTH,
Martin-
- Original Message - 
From: "Garner, Shawn" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" 
Sent: Tuesday, November 08, 2005 1:08 PM
Subject: RE: Validation seemingly not getting called any longer


>I think you need something in the struts config file telling it to use the
> validation plugin. Try that line of investigation.
> Not sure off the top of my head.
>
> Shawn D. Garner
>
> -Original Message-
> From: Preston CRAWFORD [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, November 08, 2005 11:39 AM
> To: user@struts.apache.org
> Subject: Validation seemingly not getting called any longer
>
> We have a simple login form. By the book. For some reason all of a
> sudden the validation in validation.xml is no longer getting called.
> We
> have validate set to true in the action. Everything is still named the
> same. Any idea why this would have changed or where to start looking?
>
> Preston
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

> This email may contain confidential material.
> If you were not an intended recipient,
> Please notify the sender and delete all copies.
> We may monitor email to and from our network.
>

>
> -
> 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]

 
This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 


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



RE: Validation seemingly not getting called any longer

2005-11-08 Thread Preston CRAWFORD
I have that. Either way the bottom line for me is it flys past
validation, message or no message. So I need to figure out why that is
happening.

Preston

>>> [EMAIL PROTECTED] 11/8/2005 1:56 PM >>>
I think you also need a tag in the jsp page using it.

-Original Message-
From: Martin Gainty [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 08, 2005 12:39 PM
To: Struts Users Mailing List
Subject: Re: Validation seemingly not getting called any longer

yes
validation.xml and
validator-rules.xml
are both configured as properties via plug-in in struts-config.xml
http://www.oracle.com/technology/oramag/oracle/04-jan/o14dev_struts.html

HTH,
Martin-
- Original Message - 
From: "Garner, Shawn" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" 
Sent: Tuesday, November 08, 2005 1:08 PM
Subject: RE: Validation seemingly not getting called any longer


>I think you need something in the struts config file telling it to use
the
> validation plugin. Try that line of investigation.
> Not sure off the top of my head.
>
> Shawn D. Garner
>
> -Original Message-
> From: Preston CRAWFORD [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, November 08, 2005 11:39 AM
> To: user@struts.apache.org 
> Subject: Validation seemingly not getting called any longer
>
> We have a simple login form. By the book. For some reason all of a
> sudden the validation in validation.xml is no longer getting called.
> We
> have validate set to true in the action. Everything is still named
the
> same. Any idea why this would have changed or where to start
looking?
>
> Preston
>
>
-
> To unsubscribe, e-mail: [EMAIL PROTECTED] 
> For additional commands, e-mail: [EMAIL PROTECTED] 
>
>

> This email may contain confidential material.
> If you were not an intended recipient,
> Please notify the sender and delete all copies.
> We may monitor email to and from our network.
>

>
>
-
> 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] 



This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 


-
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 seemingly not getting called any longer

2005-11-08 Thread Garner, Shawn
I think you also need a tag in the jsp page using it.

-Original Message-
From: Martin Gainty [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 08, 2005 12:39 PM
To: Struts Users Mailing List
Subject: Re: Validation seemingly not getting called any longer

yes
validation.xml and
validator-rules.xml
are both configured as properties via plug-in in struts-config.xml
http://www.oracle.com/technology/oramag/oracle/04-jan/o14dev_struts.html
HTH,
Martin-
- Original Message - 
From: "Garner, Shawn" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" 
Sent: Tuesday, November 08, 2005 1:08 PM
Subject: RE: Validation seemingly not getting called any longer


>I think you need something in the struts config file telling it to use the
> validation plugin. Try that line of investigation.
> Not sure off the top of my head.
>
> Shawn D. Garner
>
> -Original Message-
> From: Preston CRAWFORD [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, November 08, 2005 11:39 AM
> To: user@struts.apache.org
> Subject: Validation seemingly not getting called any longer
>
> We have a simple login form. By the book. For some reason all of a
> sudden the validation in validation.xml is no longer getting called.
> We
> have validate set to true in the action. Everything is still named the
> same. Any idea why this would have changed or where to start looking?
>
> Preston
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

> This email may contain confidential material.
> If you were not an intended recipient,
> Please notify the sender and delete all copies.
> We may monitor email to and from our network.
>

>
> -
> 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]

 
This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 


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



Re: Validation seemingly not getting called any longer

2005-11-08 Thread Preston CRAWFORD
Nothing that I can see. What could I log to find out what's going on? It
basically just doesn't get called.

Preston

>>> [EMAIL PROTECTED] 11/8/2005 10:52 AM >>>
Preston CRAWFORD wrote:

>We have a simple login form. By the book. For some reason all of a
>sudden the validation in validation.xml is no longer getting called.
>We have validate set to true in the action. Everything is still named
the
>same. Any idea why this would have changed or where to start looking?
>  
>
Anything in the logfiles?

If not, I'd do a diff against the last working version from your 
repository and verify that nothing really changed.

Dave



-
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 Question how to echo back users input in error message?

2005-11-08 Thread Niall Pemberton
The short answer is that there isn't a way to echo back user input in the
error message. Most of the time I don't think its necessary to do so
anyway - since if you're re-displaying/highlighting errors then what is the
need. The one time I scenario I wanted to do something like that, was when I
had a list, say for example you are displaying a list of orders and you want
a message along the lines "Order date for order number 1234 is invalid" -
where the order number "1234" is a value from the list.

There are two places that I know of, where this kind of functionality has
been provided. The first is in the "extends validator" I wrote (see the
"indexed example"):

   http://www.niallp.pwp.blueyonder.co.uk/strutsvalidatorextends.html

...and the other place was in the javascript validator extension I started
work on:

   http://www.niallp.pwp.blueyonder.co.uk/validatorjs.html

Hopefully, one day I will find some time to work on validator to make these
kind of features standard - but for now theres nothing "out of the box" to
meet this requirement.

Niall

- Original Message - 
From: "Michael Jouravlev" <[EMAIL PROTECTED]>
Sent: Friday, November 04, 2005 6:01 PM


I would like to know the answer on this too. I searched the Net, all
examples use properties from property file. Using resource="false"
does not help with either (neither?) of these variants:






where registrationForm is action form definition in struts-config.xml,
nestedUser is a nested BO. Originating mail address is rendered in
HTML and submitted back to application as "nestedUser.fromAddress".

Commons Validator does not process HttpServletRequest (that is
expected). I glanced at ValidatorForm from Struts Validator
integration, and saw this validate() method:

public ActionErrors validate(ActionMapping mapping,
 HttpServletRequest request) {

  ServletContext application = getServlet().getServletContext();
  ActionErrors errors = new ActionErrors();

  String validationKey = getValidationKey(mapping, request);

  Validator validator = Resources.initValidator(validationKey,
this, application, request, errors, page);

  try {
validatorResults = validator.validate();
  } catch (ValidatorException e) {
log.error(e.getMessage(), e);
  }

  return errors;
}

So, maybe you want to debug this one.

Commons Validator basically does not have documentation, only
Javadocs, which is not very descriptive. No comments in the source,
either. This is frustrating.

Michael.

On 11/4/05, Troy Bull <[EMAIL PROTECTED]> wrote:
> I am using the struts validator and it works almost exactly the way I
want.
>
>
> Say I have a field tf and the value is "ABC"
>
> I want to do a validation requiring it to be an integer and return the
> following error message: "tf must be an integer".
>
> I can do all this pretty easily here is the code that does it:
>
> in ApplicationResources.properties :
>
> validation.error.acty.integer={0} must be an integer and "{1}" is not.
>
> in validations.xml
>
>   
> 
> 
> 
>   
>
>
> my question is what do I put in ?? to get hte actual value the user
> entered to be echoed back out
>
> so if I type in AAA into the acty field I want the error message to be:
>
> ACTY must be an integer and "AAA" is not.
>
> Thanks Troy



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



RE: Validation seemingly not getting called any longer

2005-11-08 Thread Preston CRAWFORD
I have that.


   


And my action looks like this...






Preston

>>> [EMAIL PROTECTED] 11/8/2005 10:08 AM >>>
I think you need something in the struts config file telling it to use
the
validation plugin. Try that line of investigation.
Not sure off the top of my head.

Shawn D. Garner

-Original Message-
From: Preston CRAWFORD [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 08, 2005 11:39 AM
To: user@struts.apache.org 
Subject: Validation seemingly not getting called any longer

We have a simple login form. By the book. For some reason all of a
sudden the validation in validation.xml is no longer getting called.
We
have validate set to true in the action. Everything is still named the
same. Any idea why this would have changed or where to start looking?

Preston

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



This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 


-
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 seemingly not getting called any longer

2005-11-08 Thread Dave Newton

Preston CRAWFORD wrote:


We have a simple login form. By the book. For some reason all of a
sudden the validation in validation.xml is no longer getting called.
We have validate set to true in the action. Everything is still named the
same. Any idea why this would have changed or where to start looking?
 


Anything in the logfiles?

If not, I'd do a diff against the last working version from your 
repository and verify that nothing really changed.


Dave



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



Re: Validation seemingly not getting called any longer

2005-11-08 Thread Martin Gainty

yes
validation.xml and
validator-rules.xml
are both configured as properties via plug-in in struts-config.xml
http://www.oracle.com/technology/oramag/oracle/04-jan/o14dev_struts.html
HTH,
Martin-
- Original Message - 
From: "Garner, Shawn" <[EMAIL PROTECTED]>

To: "'Struts Users Mailing List'" 
Sent: Tuesday, November 08, 2005 1:08 PM
Subject: RE: Validation seemingly not getting called any longer



I think you need something in the struts config file telling it to use the
validation plugin. Try that line of investigation.
Not sure off the top of my head.

Shawn D. Garner

-Original Message-
From: Preston CRAWFORD [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 08, 2005 11:39 AM
To: user@struts.apache.org
Subject: Validation seemingly not getting called any longer

We have a simple login form. By the book. For some reason all of a
sudden the validation in validation.xml is no longer getting called.
We
have validate set to true in the action. Everything is still named the
same. Any idea why this would have changed or where to start looking?

Preston

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


This email may contain confidential material.
If you were not an intended recipient,
Please notify the sender and delete all copies.
We may monitor email to and from our network.


-
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 seemingly not getting called any longer

2005-11-08 Thread Garner, Shawn
I think you need something in the struts config file telling it to use the
validation plugin. Try that line of investigation.
Not sure off the top of my head.

Shawn D. Garner

-Original Message-
From: Preston CRAWFORD [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 08, 2005 11:39 AM
To: user@struts.apache.org
Subject: Validation seemingly not getting called any longer

We have a simple login form. By the book. For some reason all of a
sudden the validation in validation.xml is no longer getting called.
We
have validate set to true in the action. Everything is still named the
same. Any idea why this would have changed or where to start looking?

Preston

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

 
This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 


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



Re: Validation Question how to echo back users input in error message?

2005-11-04 Thread Michael Jouravlev
I would like to know the answer on this too. I searched the Net, all
examples use properties from property file. Using resource="false"
does not help with either (neither?) of these variants:






where registrationForm is action form definition in struts-config.xml,
nestedUser is a nested BO. Originating mail address is rendered in
HTML and submitted back to application as "nestedUser.fromAddress".

Commons Validator does not process HttpServletRequest (that is
expected). I glanced at ValidatorForm from Struts Validator
integration, and saw this validate() method:

public ActionErrors validate(ActionMapping mapping,
 HttpServletRequest request) {

  ServletContext application = getServlet().getServletContext();
  ActionErrors errors = new ActionErrors();

  String validationKey = getValidationKey(mapping, request);

  Validator validator = Resources.initValidator(validationKey,
this, application, request, errors, page);

  try {
validatorResults = validator.validate();
  } catch (ValidatorException e) {
log.error(e.getMessage(), e);
  }

  return errors;
}

So, maybe you want to debug this one.

Commons Validator basically does not have documentation, only
Javadocs, which is not very descriptive. No comments in the source,
either. This is frustrating.

Michael.

On 11/4/05, Troy Bull <[EMAIL PROTECTED]> wrote:
> I am using the struts validator and it works almost exactly the way I want.
>
>
> Say I have a field tf and the value is "ABC"
>
> I want to do a validation requiring it to be an integer and return the
> following error message: "tf must be an integer".
>
> I can do all this pretty easily here is the code that does it:
>
> in ApplicationResources.properties :
>
> validation.error.acty.integer={0} must be an integer and "{1}" is not.
>
> in validations.xml
>
>   
> 
> 
> 
>   
>
>
> my question is what do I put in ?? to get hte actual value the user
> entered to be echoed back out
>
> so if I type in AAA into the acty field I want the error message to be:
>
> ACTY must be an integer and "AAA" is not.
>
> Thanks Troy

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



Re: Validation and error messages in session

2005-10-17 Thread Adam Hardy

It's a shame no-one answered this. I was interested in reading a reply.

My situation is that on validation failure, my 'input' mapping is to 
another action, not direct to a JSP, so that I can carry out the 
necessary view helper code. As part of this I can also grab the 
validation errors from the request scope and save them in session if I want.


However I like the idea of declaring that the errors go straight into 
session scope.


Adam

Robert Taylor on 16/10/05 11:10, wrote:
Greetings, I'm using Struts 1.2.7 and noticed that functionality has 
been added to the Action class to store error messages in the session 
and subsequently be removed after they have been rendered. This is quite 
helpful in some circumstances.


I also know that error messages can be placed in the session or request 
scope when using the Exception handling framework. Again, this is quite 
helpful in some circumstances.


Are there plans to add this to the Validation framework as well such 
that we can declaratively identify the scope in which to place the 
validation messages. I know that upon a validation error that the 
default RequestProcessor forwards to a configured url and that since the 
request is forwarded, then there is no need to store them in the session.


I recently came upon a case where I have a page with conditionally 
"imported" page fragments. The page fragment contained an iframe with 
some dynamic text input fields. Upon a validation error in the iframe, 
it forwarded the request to its parent which subsequently rendered the 
page which subsequently and conditionally imported the page which was 
supposed to contain the validation error message. Since the import 
(c:import) was considered a separate request, the validation error 
messages was lost.


I ended up subclassing the ActionMapping class, adding a 
validationMessageScope property.
I also subclassed the RequestProcessor processValidate() and added logic 
to look for the subclassed ActionMapping class; if found to look up the 
scope into which to place the validation error messages. If the property 
had not been set, defaulted to the request scope.


So when ever I need to propogate the validation error message across 
requests, I just add a value="session"/> and the error messages is placed in the session.
Struts takes care of removing the error messages from the session after 
they have been rendered.


I know this is a special case. The only reason I ask is that Struts 
already supports the concept of storing the messages in the session and 
the current Exception Handling framework supports this concept. It 
didn't seem like too much of a stretch, to allow the Validation 
framework to support it.


Just a thought.

/robert


-
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 Configuration for Multiple Modules

2005-10-13 Thread Adam Hardy

Sorry forgot to mention, I set it up with struts 1.1 (not the beta tho!)

Yes you can use bugzilla to look for an old bug. A key word search is 
probably easiest but the search parameters on bugzilla can be set quite 
extensively.


Sympathy for your situation. What a pain.

Adam

[EMAIL PROTECTED] on 13/10/05 10:50, wrote:

Thanks Adam.

I'm sure no one will be able to verify whether this was a bug in 1.1b2 
(why I'm using b2 is a looong story, but I'm stuck with it).


Is there a way I can find out from Bugzilla whether this was a bug that 
was fixed in later versions?



- Original Message - 
From  Adam Hardy <[EMAIL PROTECTED]> 
Date  Wed, 12 Oct 2005 21:02:00 +0100 
To  Struts Users Mailing List  
Subject  Re: Validation Configuration for Multiple Modules 



[EMAIL PROTECTED] on 11/10/05 07:20, wrote:

I'm using *Struts 1.1* to build an application with multiple Struts 
modules.


I put my validations for each module in a seperate validations.xml 
file. For example, I have validations-a.xml for module a and 
validations-b.xml for module b. I then found out that although the 
validations are working perfectly for module a, they're not working 


at 


all for module b.

I kept tracing the problem even in the Struts source code, and 


reached 

the conclusion that the validations for one module overwrite the 


other. 

It seems that the FormSet objects are stored in a HashMap with the 
locale as the key, and since both formsets have the same locale, one 


of 

them overwrites the other. Are my conclusions correct or am I doing 
something wrong? Does that mean I have to put all my validations for 
the whole application in one file?



Presumably in each module's struts-config, your validator plugin node 
refers to the correct validation.xml?


I doubt it's a bug since I successfully set up modularised struts with 
seperate validation.xml for each.




Adam




-
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 Configuration for Multiple Modules

2005-10-13 Thread tarek . nabil
Thanks Adam.

I'm sure no one will be able to verify whether this was a bug in 1.1b2 
(why I'm using b2 is a looong story, but I'm stuck with it).

Is there a way I can find out from Bugzilla whether this was a bug that 
was fixed in later versions?


- Original Message - 
>From  Adam Hardy <[EMAIL PROTECTED]> 
Date  Wed, 12 Oct 2005 21:02:00 +0100 
To  Struts Users Mailing List  
Subject  Re: Validation Configuration for Multiple Modules 


[EMAIL PROTECTED] on 11/10/05 07:20, wrote:
> I'm using *Struts 1.1* to build an application with multiple Struts 
> modules.
> 
> I put my validations for each module in a seperate validations.xml 
> file. For example, I have validations-a.xml for module a and 
> validations-b.xml for module b. I then found out that although the 
> validations are working perfectly for module a, they're not working 
at 
> all for module b.
> 
> I kept tracing the problem even in the Struts source code, and 
reached 
> the conclusion that the validations for one module overwrite the 
other. 
> It seems that the FormSet objects are stored in a HashMap with the 
> locale as the key, and since both formsets have the same locale, one 
of 
> them overwrites the other. Are my conclusions correct or am I doing 
> something wrong? Does that mean I have to put all my validations for 
> the whole application in one file?

Presumably in each module's struts-config, your validator plugin node 
refers to the correct validation.xml?

I doubt it's a bug since I successfully set up modularised struts with 
seperate validation.xml for each.



Adam




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



Re: Validation Configuration for Multiple Modules

2005-10-12 Thread Adam Hardy

[EMAIL PROTECTED] on 11/10/05 07:20, wrote:
I'm using *Struts 1.1* to build an application with multiple Struts 
modules.


I put my validations for each module in a seperate validations.xml 
file. For example, I have validations-a.xml for module a and 
validations-b.xml for module b. I then found out that although the 
validations are working perfectly for module a, they're not working at 
all for module b.


I kept tracing the problem even in the Struts source code, and reached 
the conclusion that the validations for one module overwrite the other. 
It seems that the FormSet objects are stored in a HashMap with the 
locale as the key, and since both formsets have the same locale, one of 
them overwrites the other. Are my conclusions correct or am I doing 
something wrong? Does that mean I have to put all my validations for 
the whole application in one file?


Presumably in each module's struts-config, your validator plugin node 
refers to the correct validation.xml?


I doubt it's a bug since I successfully set up modularised struts with 
seperate validation.xml for each.




Adam

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



Re: Validation of input field requires SQL. Better to put it in Form or in Action?

2005-09-21 Thread Jeff Beal
In general, ActionForm validation is limited to the most basic input
validation, mostly making sure that incoming strings can be parsed
into a specific type.  If you need to issue a SQL query to ensure
valid data, that sounds like a business logic operation, and probably
makes more sense in the Action or even the business layer.

-- Jeff

On 9/20/05, gollinger <[EMAIL PROTECTED]> wrote:
> Hi In my HTML-Form I'm sending a number to a action.
> If the number is valid will be decided by a sql-query.
> I'm not sure to put this select in the ActionForms validate
> method or in the action with a corresponding forward.
>
> What would be the better way?
>
> Thanks for any opinions!
>
>
> -
> 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: Re: Validation Issue

2005-09-15 Thread Amol Yadwadkar
Thankx a lot!!!
It worked

best regds, 
AMOL YADWADKAR | Software Engineer | M P H A S I S  Architecting Value|
IT SERVICES
2nd Floor, The Leela Business Park, Andheri Kurla Road, Andheri(E),
Mumbai 400059| 
Tel: 91 22 5677 Extn 5356 | Fax: 91 22 5600| Cell : 9819011934 |
www.mphasis.com

 

Information transmitted by this e-mail is proprietary to MphasiS and/ or
its Customers and is intended for use only by the individual or entity
to which it is addressed, and may contain information that is
privileged, confidential or exempt from disclosure under applicable law.
If you are not the intended recipient or it appears that this mail has
been forwarded to you without proper authority, you are notified that
any use or dissemination of this information in any manner is strictly
prohibited. In such cases, please notify us immediately at
[EMAIL PROTECTED] and delete this mail from your records.

 

-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper
Sent: Friday, September 16, 2005 4:37 AM
To: user@struts.apache.org
Subject: Re: Validation Issue

Amol Yadwadkar wrote:
> Hi List,
> 
> I am using Validation Framework.
> 
>  property="clientTaxId"
> depends="required,mask" >
> 
> 
> 
> mask
> ${taxid}
> 
> 
> 
> In the above when mask rule fails it picks up the message against the
> errors.invalid key in the properties file rather than the specified
>  key as "prompt.taxid" in validation.xml 
>  
> Can anyone pls suggest me my mistake ?

The arg* attributes are for passing in values for placeholders in the 
default error messages. If you want to specify a different error 
message, you want the 'msg' attribute instead:

   

L.


-
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 Issue

2005-09-15 Thread Laurie Harper

Amol Yadwadkar wrote:

Hi List,

I am using Validation Framework.

property="clientTaxId"

depends="required,mask" >



mask
${taxid}



In the above when mask rule fails it picks up the message against the
errors.invalid key in the properties file rather than the specified
 key as "prompt.taxid" in validation.xml 
 
Can anyone pls suggest me my mistake ?


The arg* attributes are for passing in values for placeholders in the 
default error messages. If you want to specify a different error 
message, you want the 'msg' attribute instead:


  

L.


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



Re: Validation :: best practice?

2005-09-09 Thread Michael Jouravlev
On 9/9/05, emre akbas <[EMAIL PROTECTED]> wrote:
> Hi,
> I want to know what the state-of-the-art practices about Struts validation
> are.

Try these:
  https://strutslive.dev.java.net
  https://formdef.dev.java.net

> It is well-known that there are some problems in automatic validation.
> Here is a good article:
> http://www.reumann.net/struts/articles/request_lists.jsp Are the ideas in
> this article obsolete?

No more obsolete than Struts itself. Anyway, because I try to keep all
action-related stuff in the ActionForm, I never encountered the issue
of losing request-scoped objects. It seems a little strange to me,
that request-scoped objects are lost on forward, which happens on the
server.

> As far as I understand, the best practice is calling the validate() method
> manually. This requires that we write ... validate="false" ... in the
> action-mapping definition. However, if we do this, we cannot use javascript
> (client-size) validation. I want to use javascript validation. What are the
> possible solutions?

Struts cannot decide whether the tags should or should not generate
client-side validation javascript in the JSP pages belonging to an
action, simply because Struts does not have the notion of a JSP page
"belonging" to a certain action class. Actions and pages are
interlaced in a chain fashion and generally you don't know which
action the data from a page will be submitted to.

Therefore client-side validation is set separately with
 tag on JSP page, while automatic server-side
validation is set with validate="true" in the action mapping
definition.

Michael.

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



Re: Validation :: best practice?

2005-09-09 Thread Rick Reumann

emre akbas wrote the following on 9/9/2005 10:12 AM:
 ,
I want to know what the state-of-the-art practices about Struts validation 
are. It is well-known that there are some problems in automatic validation. 
Here is a good article: 
http://www.reumann.net/struts/articles/request_lists.jsp Are the ideas in 
this article obsolete? 


I don't think they are obsolete. I still find it easier to call validate 
manually. (By the way, in that article, I mention a technique that I 
really don't use myself.. I don't even bother calling the form's 
validate method. I actually provide my own validate() method in my 
Action that validates what I want. Both work ok though and since many 
already have a validate method in their ActionForm, I used that as the 
example for the lesson.)


As far as I understand, the best practice is calling the validate() method 
manually. 


If you have session based forms or you do not need to re-display 
non-ActionForm objects back on the page if validation fails, the 
standard validation framework is 'ok', but I still like to do do things 
one consistent way so doing my validation in my actions works for me. I 
will almost bet there will be a time when you'll run into some headaches 
trying to use the validation frameworks as it stands. (Validation in 
struts is not one of Struts' strong points unfortunately. It's one of 
the number one headaches for beginning struts users.)


This requires that we write ... validate="false" ... in the 
action-mapping definition. 


If I remember correctly, if you leave off the validate="false" it 
defaults to false. You just need to set it to true if you want 
validation, but I could be wrong there.. it's been a while:)


However, if we do this, we cannot use javascript 
(client-size) validation. I want to use javascript validation. What are the 
possible solutions? 


I never had too much luck with the client side validation stuff and I 
only use it in *very* limited circumstances, since I like validating on 
the server side.  The javascript validation with the validator seemed 
more of a headache then it was worth when I first started trying it out 
(I'm sure it's improved a lot since then, so it might work nicely for 
you). For client side validation I just write my own and don't rely on 
the validator stuff to handle it. Since I rarely validate on the client 
it's not much of an issue for me.


--
Rick

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



Re: Validation :: best practice?

2005-09-09 Thread Niall Pemberton
I think you're assertion is incorrect. including the  tag
on a page will generate all the javascript validations for a form - they get
"invoked" by you putting some javascript in the 's onsubmit
event - nothing to do with the validate setting in the struts config. All
the validate=false setting controls is server side validation.

Niall

- Original Message - 
From: "emre akbas" <[EMAIL PROTECTED]>
Sent: Friday, September 09, 2005 3:12 PM

> This requires that we write ... validate="false" ... in the
> action-mapping definition. However, if we do this, we cannot use
javascript
> (client-size) validation. I want to use javascript validation



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



Re: Validation Rules method not found

2005-08-15 Thread David McReynolds
I just fixed this. You have mixed up the versions of the
validator-rules.xml and the struts jar. Either go back to struts jar
1.1 or upgrade the validator-rules.xml.

On 8/12/05, Doug Thomas <[EMAIL PROTECTED]> wrote:
> While implementing struts validation for the first time (yup - I'm a
> newbie), I received a NoSuchMethodException during runtime. The exact error
> on the console log was:
> 
> [8/12/05 12:49:19:062 EDT] 0042 Validator E   TRAS0014I: The
> following exception was logged java.lang.NoSuchMethodException:
> org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Object,
> org.apache.commons.validator.ValidatorAction,
> org.apache.commons.validator.Field, org.apache.struts.action.ActionMessages,
> javax.servlet.http.HttpServletRequest)
> 
> My validate file contains:
> 
> 
>  
>   depends="required" >
>
>   
>   depends="required" >
>
>   
>  
> 
> 
> ...and my :
> 
>   type="org.apache.struts.validator.DynaValidatorForm">
> type="java.lang.String" />
> type="java.lang.String" />
> type="java.lang.String" />
> type="java.lang.String" />
>   
> 
> What am I missing?
> 
> I'm thinking this is a development system (WebSphere 6.0) configuration
> error, rather than a coding error.
> 
> Thanks.
> 
> Doug Thomas
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
--dlm
www.myjavaserver.com/~dlm8751

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



Re: Validation Help

2005-07-23 Thread Rafael Taboada
A good book about Struts and Validator framework is Jakarta Struts Live - 
Rick Hightower
 U can get it in www.theserverside.com 


-- 
Rafael Taboada
Software Engineer

Cell : +511-97753290

"No creo en el destino pues no me gusta tener la idea de controlar mi vida"


Re: Validation Help

2005-07-23 Thread Rafael Taboada
the properties file is that u r using right now... I mean u can use it in 
order to call value keys.


-- 
Rafael Taboada
Software Engineer

Cell : +511-97753290

"No creo en el destino pues no me gusta tener la idea de controlar mi vida"


Re: Validation Help

2005-07-23 Thread Paul Goepfert
I have a question.  I have decided to use the vaildation framework to do 
the validation in my web app.  I have created a validation.xml file, and 
a vaildator-rules.xml file.  I noticed in books about struts that I have 
there is a properties file associated with the vaildation.   Am I right? 
If so I add it to my struts-config file, right?  


-Paul
Glen Mazza wrote:

http://www.objectsource.com/Struts_Survival_ Guide.pdf, Chapter 5.
Paul Goepfert wrote:
I have created a web app using struts and velocity.  I am going to 
add vaildation on the struts end of the app.  I am still learning 
struts.  The only thing I have been able to do is use struts to move 
between pages by way of buttons.Now I want to add validation to 
my web app.  I have  no  idea how to do it.


If anyone can help me out that would be great.

-Paul

-
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 question...

2005-07-22 Thread Aleksandar Matijaca
I like the CSS 'trick' -- I will try it tonight !

Thanks again Wendy,

Regards, Alex.


On 7/22/05, Wendy Smoak <[EMAIL PROTECTED]> wrote:
> 
> From: "Aleksandar Matijaca" <[EMAIL PROTECTED]>
> > I would like
> > to automatically place a little red * right beside the input field.
> > For my password confirmation field, wnen I put
> > 
> > beside the text field, I get the WHOLE STRING for the 'required'
> > validation,
> > instead, I would like to display only a *.
> 
> The  tag might help...
> http://struts.apache.org/userGuide/struts-logic.html#messagesPresent
> 
> There are also 'errorStyle' and 'errorStyleClass' on the  tags. If
> you can do it in CSS, you can apply it to the form element _only_ when 
> there
> is an error for that property.
> 
> --
> Wendy Smoak
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>


Re: validation question...

2005-07-21 Thread Wendy Smoak

From: "Aleksandar Matijaca" <[EMAIL PROTECTED]>

I would like
to automatically place a little red * right beside the input field.
For my password confirmation field, wnen I put

beside the text field, I get the WHOLE STRING for the 'required' 
validation,

instead, I would like to display only a *.


The  tag might help...
http://struts.apache.org/userGuide/struts-logic.html#messagesPresent

There are also 'errorStyle' and 'errorStyleClass' on the  tags.  If 
you can do it in CSS, you can apply it to the form element _only_ when there 
is an error for that property.


--
Wendy Smoak 




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



Re: validation question...

2005-07-21 Thread Aleksandar Matijaca
It didn't work, but thanks for the effort Laurie...
 Regards, Alex.


 On 7/21/05, Laurie Harper <[EMAIL PROTECTED]> wrote: 
> 
> You could add errorClassId on the input element and use CSS to insert an
> image of a little red *... :-) I can't think of a clean way to find out if
> an error exists for a particular property though. This might work (haven't
> tried it):
> 
> *
> 
> L.
> 
> Aleksandar Matijaca wrote:
> 
> > Hi there,
> > I am currently using the struts validator, and it is working pretty 
> good.
> > My basic error block looks like this:
> >
> >
> > 
> >
> >
> > 
> > 
> >  > />
> > 
> > 
> >
> > 
> >   
> > 
> > 
> > 
> > 
> >
> > 
> >
> > As I said, it loks fairly simple and it works. HOWEVER, I would like
> > to automatically place a little red * right beside the input field.
> > For my password confirmation field, wnen I put
> >
> > 
> >
> > beside the text field, I get the WHOLE STRING for the 'required' 
> validation,
> > instead, I would like to display only a *. I tried
> > *
> > But that does not work, because html:errors tag does not take a body...
> > Any ideas?
> > Thanks, Alex.
> >
> 
> 
> --
> Laurie, Open Source advocate, Java geek and novice blogger:
> http://www.holoweb.net/laurie
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>


Re: validation question...

2005-07-21 Thread Aleksandar Matijaca
Thanks Laurie, I will try it !!
 Cheers, Alex.


 On 7/21/05, Laurie Harper <[EMAIL PROTECTED]> wrote: 
> 
> You could add errorClassId on the input element and use CSS to insert an
> image of a little red *... :-) I can't think of a clean way to find out if
> an error exists for a particular property though. This might work (haven't
> tried it):
> 
> *
> 
> L.
> 
> Aleksandar Matijaca wrote:
> 
> > Hi there,
> > I am currently using the struts validator, and it is working pretty 
> good.
> > My basic error block looks like this:
> >
> >
> > 
> >
> >
> > 
> > 
> >  > />
> > 
> > 
> >
> > 
> >   
> > 
> > 
> > 
> > 
> >
> > 
> >
> > As I said, it loks fairly simple and it works. HOWEVER, I would like
> > to automatically place a little red * right beside the input field.
> > For my password confirmation field, wnen I put
> >
> > 
> >
> > beside the text field, I get the WHOLE STRING for the 'required' 
> validation,
> > instead, I would like to display only a *. I tried
> > *
> > But that does not work, because html:errors tag does not take a body...
> > Any ideas?
> > Thanks, Alex.
> >
> 
> 
> --
> Laurie, Open Source advocate, Java geek and novice blogger:
> http://www.holoweb.net/laurie
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>


Re: validation question...

2005-07-21 Thread Laurie Harper
You could add errorClassId on the input element and use CSS to insert an 
image of a little red *... :-) I can't think of a clean way to find out if 
an error exists for a particular property though. This might work (haven't 
tried it):


  *

L.

Aleksandar Matijaca wrote:


Hi there,
I am currently using the struts validator, and it is working pretty good.
My basic error block looks like this:







/>





  






 
As I said, it loks fairly simple and it works. HOWEVER, I would like

to automatically place a little red * right beside the input field.
For my password confirmation field, wnen I put



beside the text field, I get the WHOLE STRING for the 'required' validation,
instead, I would like to display only a *. I tried
 *
 But that does not work, because html:errors tag does not take a body...
 Any ideas?
 Thanks, Alex.




--
Laurie, Open Source advocate, Java geek and novice blogger:
http://www.holoweb.net/laurie


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



Re: Validation Help

2005-07-20 Thread Glen Mazza

http://www.objectsource.com/Struts_Survival_Guide.pdf, Chapter 5.

Paul Goepfert wrote:
I have created a web app using struts and velocity.  I am going to add 
vaildation on the struts end of the app.  I am still learning struts.  
The only thing I have been able to do is use struts to move between 
pages by way of buttons.Now I want to add validation to my web app.  
I have  no  idea how to do it.


If anyone can help me out that would be great.

-Paul

-
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 is called before form is populated from my database

2005-07-20 Thread William Shief
Finally, I found two valuable solutions to my problem.

The first one is MappingDispatchAction, as suggested
by Hubert. It is efficient but I dislike to have so
much entries in my struts-config (my application is
going big enough)
I found a good explanation for it by the frustrated
programmer (who gives us some remarks about Struts
which were helpful for me)
http://frustratedprogrammer.blogspot.com/2004/07/struts-121-mappingdispatchaction.html

The second one is to redefine the methode "validate"
in my form-bean (EditionPersonneForm, which extends
validator.ValidateForm) and add a condition in it,
which enables validation or not, according to my
dispatch parameter "do".
public ActionErrors validate(ActionMapping mapping,
javax.servlet.http.HttpServletRequest request)
{
if (someCondition)
{ 
return new ActionErrors(); 
}

return super.validate(mapping, request);
}

Thanks again, Hubert !

Billy


--- Hubert Rabago <[EMAIL PROTECTED]> wrote:

> Another option is to switch to
> MappingDispatchAction* so you can set
> different attributes for the different situations
> that your Action
> needs to handle.
> 
> Hubert
> 
>
*http://struts.apache.org/api/org/apache/struts/actions/MappingDispatchAction.html
> 
> On 7/19/05, Hubert Rabago <[EMAIL PROTECTED]> wrote:
> > No, always respond to the user list when it's
> relevant to the question
> > you posted.  This way, other people can offer
> solutions as well, and
> > those having the same problems will get to
> hear/read what the solution
> > is.
> > 
> > Since you're extending DispatchAction, you
> probably should turn off
> > automatic validation and handle it yourself. 
> Search the archives for
> > discussion on automatic validation, it's been
> discussed a lot the past
> > few months.
> > 
> > Mail archives are available at
> > http://marc.theaimsgroup.com/?l=struts-user and
> >
> http://www.mail-archive.com/user@struts.apache.org/
> > 
> > Hubert
> > 
> > On 7/19/05, William Shief
> <[EMAIL PROTECTED]> wrote:
> > > Unfortunately EditerPersonneAction do extend
> > > DispatchAction (using parameter "do") !
> (Otherwise
> > > your solution would be good)
> > >
> > > (I answer you personally because I assume such a
> > > message is not useful for the list)
> > >
> > > Billy
> > >
> > > --- Hubert Rabago <[EMAIL PROTECTED]> wrote:
> > >
> > > > It seems that you're trying to prepopulate a
> form
> > > > with values from the
> > > > DB before showing it to the user.
> > > >
> > > > So, you have
> > > > 1) call /EditionPersonne to prepopulate the
> form
> > > > 2) show EditerPersonne.jsp to display the form
> > > > 3) submit the form to
> /SomePathLikeSubmitPersonne
> > > >
> > > > If so, you don't need to specify the "form"
> > > > attribute in
> > > > /EditionPersonne.  The "form" attribute
> identifies
> > > > the input form for
> > > > that Action, to carry the data being submitted
> to
> > > > that Action.
> > > >
> > > > Try removing the "scope", "form" and "input"
> > > > attributes to
> > > > /EditionPersonne, and specify them instead on
> the
> > > > Action to which the
> > > > form will be submitted to.
> > > >
> > > > On the other hand, if EditerPersonneAction
> extends a
> > > > DispatchAction
> > > > class, send another message and we'll offer a
> > > > different solution.
> > > >
> > > > Hubert
> > > >
> > > >
> > > > On 7/19/05, William Shief
> > > > <[EMAIL PROTECTED]> wrote:
> > > > > Hello,
> > > > > I'm currently having a problem with the
> Struts
> > > > > validator.
> > > > > I have a very simple Struts bean
> > > > "EditionPersonneForm"
> > > > > (extending
> > > > > ValidatorForm) associated with an action
> > > > > "EditerPersonneAction" and a
> > > > > JSP form "EditerPersonne.jsp"
> > > > >
> > > > > [From struts-config.xml]
> > > > >  path="/EditionPersonne"
> > > > >
> > > > >
> type="com.myproject.actions.EditerPersonneAction"
> > > > > scope="session"
> > > > > name="EditerPersonneForm"
> > > > >
> > > > > input="/pages/EditerPersonne.jsp"
> > > > > parameter="do"
> > > > > validate="true">
> > > > >  > > > > name="afficherEditionPersonne"
> > > > > path="/pages/EditionPersonne.jsp"/>
> > > > >  > > > > name="afficherAjoutPersonne"
> > > > >
> > > > > path="/pages/AjoutPersonne.jsp" />
> > > > > 
> > > > > [end of listing]
> > > > >
> > > > > The matter is that the method validate() is
> called
> > > > > BEFORE the form is
> > > > > displayed. So if the Struts bean is filled
> in with
> > > > > wrong values at this
> > > > >
> > > > > very moment, the validator causes an error
> and
> > > > Struts
> > > > > redirects me to
> > > > > the "input" error page, and the action
> (which
> > > > > populates the form
> > > > > with the right data from the database) is
> never
> > > > called
> > > > > !
> > > > > Does anyone have a clue ?
> > > > > Thanks in advance,
> > > 

Re: Validation Help

2005-07-19 Thread Laurie Harper

Paul Goepfert wrote:
I have created a web app using struts and velocity.  I am going to add 
vaildation on the struts end of the app.  I am still learning struts.  
The only thing I have been able to do is use struts to move between 
pages by way of buttons.Now I want to add validation to my web app.  
I have  no  idea how to do it.


If anyone can help me out that would be great.


I'd suggest looking at Struts Validator [1] as a starting point. If that 
doesn't meet your needs, I'm sure other suggestions will follow ;-)


[1] http://struts.apache.org/userGuide/dev_validator.html

L.
--
Laurie, Open Source advocate, Java geek and novice blogger:
http://www.holoweb.net/laurie


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



Re: Validation is called before form is populated from my database

2005-07-19 Thread Hubert Rabago
Another option is to switch to MappingDispatchAction* so you can set
different attributes for the different situations that your Action
needs to handle.

Hubert

*http://struts.apache.org/api/org/apache/struts/actions/MappingDispatchAction.html

On 7/19/05, Hubert Rabago <[EMAIL PROTECTED]> wrote:
> No, always respond to the user list when it's relevant to the question
> you posted.  This way, other people can offer solutions as well, and
> those having the same problems will get to hear/read what the solution
> is.
> 
> Since you're extending DispatchAction, you probably should turn off
> automatic validation and handle it yourself.  Search the archives for
> discussion on automatic validation, it's been discussed a lot the past
> few months.
> 
> Mail archives are available at
> http://marc.theaimsgroup.com/?l=struts-user and
> http://www.mail-archive.com/user@struts.apache.org/
> 
> Hubert
> 
> On 7/19/05, William Shief <[EMAIL PROTECTED]> wrote:
> > Unfortunately EditerPersonneAction do extend
> > DispatchAction (using parameter "do") ! (Otherwise
> > your solution would be good)
> >
> > (I answer you personally because I assume such a
> > message is not useful for the list)
> >
> > Billy
> >
> > --- Hubert Rabago <[EMAIL PROTECTED]> wrote:
> >
> > > It seems that you're trying to prepopulate a form
> > > with values from the
> > > DB before showing it to the user.
> > >
> > > So, you have
> > > 1) call /EditionPersonne to prepopulate the form
> > > 2) show EditerPersonne.jsp to display the form
> > > 3) submit the form to /SomePathLikeSubmitPersonne
> > >
> > > If so, you don't need to specify the "form"
> > > attribute in
> > > /EditionPersonne.  The "form" attribute identifies
> > > the input form for
> > > that Action, to carry the data being submitted to
> > > that Action.
> > >
> > > Try removing the "scope", "form" and "input"
> > > attributes to
> > > /EditionPersonne, and specify them instead on the
> > > Action to which the
> > > form will be submitted to.
> > >
> > > On the other hand, if EditerPersonneAction extends a
> > > DispatchAction
> > > class, send another message and we'll offer a
> > > different solution.
> > >
> > > Hubert
> > >
> > >
> > > On 7/19/05, William Shief
> > > <[EMAIL PROTECTED]> wrote:
> > > > Hello,
> > > > I'm currently having a problem with the Struts
> > > > validator.
> > > > I have a very simple Struts bean
> > > "EditionPersonneForm"
> > > > (extending
> > > > ValidatorForm) associated with an action
> > > > "EditerPersonneAction" and a
> > > > JSP form "EditerPersonne.jsp"
> > > >
> > > > [From struts-config.xml]
> > > >  > > >
> > > > type="com.myproject.actions.EditerPersonneAction"
> > > > scope="session"
> > > > name="EditerPersonneForm"
> > > >
> > > > input="/pages/EditerPersonne.jsp"
> > > > parameter="do"
> > > > validate="true">
> > > >  > > > name="afficherEditionPersonne"
> > > > path="/pages/EditionPersonne.jsp"/>
> > > >  > > > name="afficherAjoutPersonne"
> > > >
> > > > path="/pages/AjoutPersonne.jsp" />
> > > > 
> > > > [end of listing]
> > > >
> > > > The matter is that the method validate() is called
> > > > BEFORE the form is
> > > > displayed. So if the Struts bean is filled in with
> > > > wrong values at this
> > > >
> > > > very moment, the validator causes an error and
> > > Struts
> > > > redirects me to
> > > > the "input" error page, and the action (which
> > > > populates the form
> > > > with the right data from the database) is never
> > > called
> > > > !
> > > > Does anyone have a clue ?
> > > > Thanks in advance,
> > > > Billy Bob
> > > >
> > > >
> > >
> > >
> > -
> > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > >
> > >
> >
> >
> > __
> > 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 is called before form is populated from my database

2005-07-19 Thread Hubert Rabago
No, always respond to the user list when it's relevant to the question
you posted.  This way, other people can offer solutions as well, and
those having the same problems will get to hear/read what the solution
is.

Since you're extending DispatchAction, you probably should turn off
automatic validation and handle it yourself.  Search the archives for
discussion on automatic validation, it's been discussed a lot the past
few months.

Mail archives are available at
http://marc.theaimsgroup.com/?l=struts-user and
http://www.mail-archive.com/user@struts.apache.org/

Hubert

On 7/19/05, William Shief <[EMAIL PROTECTED]> wrote:
> Unfortunately EditerPersonneAction do extend
> DispatchAction (using parameter "do") ! (Otherwise
> your solution would be good)
> 
> (I answer you personally because I assume such a
> message is not useful for the list)
> 
> Billy
> 
> --- Hubert Rabago <[EMAIL PROTECTED]> wrote:
> 
> > It seems that you're trying to prepopulate a form
> > with values from the
> > DB before showing it to the user.
> >
> > So, you have
> > 1) call /EditionPersonne to prepopulate the form
> > 2) show EditerPersonne.jsp to display the form
> > 3) submit the form to /SomePathLikeSubmitPersonne
> >
> > If so, you don't need to specify the "form"
> > attribute in
> > /EditionPersonne.  The "form" attribute identifies
> > the input form for
> > that Action, to carry the data being submitted to
> > that Action.
> >
> > Try removing the "scope", "form" and "input"
> > attributes to
> > /EditionPersonne, and specify them instead on the
> > Action to which the
> > form will be submitted to.
> >
> > On the other hand, if EditerPersonneAction extends a
> > DispatchAction
> > class, send another message and we'll offer a
> > different solution.
> >
> > Hubert
> >
> >
> > On 7/19/05, William Shief
> > <[EMAIL PROTECTED]> wrote:
> > > Hello,
> > > I'm currently having a problem with the Struts
> > > validator.
> > > I have a very simple Struts bean
> > "EditionPersonneForm"
> > > (extending
> > > ValidatorForm) associated with an action
> > > "EditerPersonneAction" and a
> > > JSP form "EditerPersonne.jsp"
> > >
> > > [From struts-config.xml]
> > >  > >
> > > type="com.myproject.actions.EditerPersonneAction"
> > > scope="session"
> > > name="EditerPersonneForm"
> > >
> > > input="/pages/EditerPersonne.jsp"
> > > parameter="do"
> > > validate="true">
> > >  > > name="afficherEditionPersonne"
> > > path="/pages/EditionPersonne.jsp"/>
> > >  > > name="afficherAjoutPersonne"
> > >
> > > path="/pages/AjoutPersonne.jsp" />
> > > 
> > > [end of listing]
> > >
> > > The matter is that the method validate() is called
> > > BEFORE the form is
> > > displayed. So if the Struts bean is filled in with
> > > wrong values at this
> > >
> > > very moment, the validator causes an error and
> > Struts
> > > redirects me to
> > > the "input" error page, and the action (which
> > > populates the form
> > > with the right data from the database) is never
> > called
> > > !
> > > Does anyone have a clue ?
> > > Thanks in advance,
> > > Billy Bob
> > >
> > >
> >
> >
> -
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> >
> >
> 
> 
> __
> 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 is called before form is populated from my database

2005-07-19 Thread William Shief
Unfortunately EditerPersonneAction do extend
DispatchAction (using parameter "do") ! (Otherwise
your solution would be good)

(I answer you personally because I assume such a
message is not useful for the list)

Billy

--- Hubert Rabago <[EMAIL PROTECTED]> wrote:

> It seems that you're trying to prepopulate a form
> with values from the
> DB before showing it to the user.
> 
> So, you have
> 1) call /EditionPersonne to prepopulate the form
> 2) show EditerPersonne.jsp to display the form
> 3) submit the form to /SomePathLikeSubmitPersonne
> 
> If so, you don't need to specify the "form"
> attribute in
> /EditionPersonne.  The "form" attribute identifies
> the input form for
> that Action, to carry the data being submitted to
> that Action.
> 
> Try removing the "scope", "form" and "input"
> attributes to
> /EditionPersonne, and specify them instead on the
> Action to which the
> form will be submitted to.
> 
> On the other hand, if EditerPersonneAction extends a
> DispatchAction
> class, send another message and we'll offer a
> different solution.
> 
> Hubert
> 
> 
> On 7/19/05, William Shief
> <[EMAIL PROTECTED]> wrote:
> > Hello,
> > I'm currently having a problem with the Struts
> > validator.
> > I have a very simple Struts bean
> "EditionPersonneForm"
> > (extending
> > ValidatorForm) associated with an action
> > "EditerPersonneAction" and a
> > JSP form "EditerPersonne.jsp"
> > 
> > [From struts-config.xml]
> >  > 
> > type="com.myproject.actions.EditerPersonneAction"
> > scope="session"
> > name="EditerPersonneForm"
> > 
> > input="/pages/EditerPersonne.jsp"
> > parameter="do"
> > validate="true">
> >  > name="afficherEditionPersonne"
> > path="/pages/EditionPersonne.jsp"/>
> >  > name="afficherAjoutPersonne"
> > 
> > path="/pages/AjoutPersonne.jsp" />
> > 
> > [end of listing]
> > 
> > The matter is that the method validate() is called
> > BEFORE the form is
> > displayed. So if the Struts bean is filled in with
> > wrong values at this
> > 
> > very moment, the validator causes an error and
> Struts
> > redirects me to
> > the "input" error page, and the action (which
> > populates the form
> > with the right data from the database) is never
> called
> > !
> > Does anyone have a clue ?
> > Thanks in advance,
> > Billy Bob
> > 
> >
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 


__
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 is called before form is populated from my database

2005-07-19 Thread Hubert Rabago
It seems that you're trying to prepopulate a form with values from the
DB before showing it to the user.

So, you have
1) call /EditionPersonne to prepopulate the form
2) show EditerPersonne.jsp to display the form
3) submit the form to /SomePathLikeSubmitPersonne

If so, you don't need to specify the "form" attribute in
/EditionPersonne.  The "form" attribute identifies the input form for
that Action, to carry the data being submitted to that Action.

Try removing the "scope", "form" and "input" attributes to
/EditionPersonne, and specify them instead on the Action to which the
form will be submitted to.

On the other hand, if EditerPersonneAction extends a DispatchAction
class, send another message and we'll offer a different solution.

Hubert


On 7/19/05, William Shief <[EMAIL PROTECTED]> wrote:
> Hello,
> I'm currently having a problem with the Struts
> validator.
> I have a very simple Struts bean "EditionPersonneForm"
> (extending
> ValidatorForm) associated with an action
> "EditerPersonneAction" and a
> JSP form "EditerPersonne.jsp"
> 
> [From struts-config.xml]
>  
> type="com.myproject.actions.EditerPersonneAction"
> scope="session"
> name="EditerPersonneForm"
> 
> input="/pages/EditerPersonne.jsp"
> parameter="do"
> validate="true">
>  name="afficherEditionPersonne"
> path="/pages/EditionPersonne.jsp"/>
>  name="afficherAjoutPersonne"
> 
> path="/pages/AjoutPersonne.jsp" />
> 
> [end of listing]
> 
> The matter is that the method validate() is called
> BEFORE the form is
> displayed. So if the Struts bean is filled in with
> wrong values at this
> 
> very moment, the validator causes an error and Struts
> redirects me to
> the "input" error page, and the action (which
> populates the form
> with the right data from the database) is never called
> !
> Does anyone have a clue ?
> Thanks in advance,
> Billy Bob
> 
>

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



Re: Validation is called before form is populated from my database

2005-07-19 Thread mah bub
Hi,
 As much I know if you need to load data when the page is load before the 
validation is called.
 You may load data when the action is called and there could be another 
action associated with the Submit button's page which will check the 
validation.
 I'm not sure whether it make you clear or not or solve the problem you 
asked for. Let me know if you need more clear explanation about my 
procedure.
 Thanks
 Mahbub


Re: Validation Framework Manual

2005-07-14 Thread James Mitchell

You can always just memorize the DTD :)

On the other hand, you could pick up a good text editor with autocompletion 
that supports DTD/XML Schema.  Even after Eclipse WTP M4 shipped, I prefer 
XML Buddy, so much so that I went ahead and purchased the Pro license a few 
months back.



--
James Mitchell
Software Engineer / Open Source Evangelist
Consulting / Mentoring / Freelance
EdgeTech, Inc.
http://www.edgetechservices.net/
678.910.8017
AIM:   jmitchtx
MSN:   [EMAIL PROTECTED]
Skype: jmitchtx

- Original Message - 
From: "Dave Newton" <[EMAIL PROTECTED]>

To: "Struts Users Mailing List" 
Sent: Thursday, July 14, 2005 8:41 PM
Subject: Re: Validation Framework Manual



Rafael Taboada wrote:


Yeah, that was the problem...
Do u know a tutorial about how to fill my validation.xml?
I want to know what i have to put in each tag.

Are the docs at http://struts.apache.org/userGuide/dev_validator.html not 
satisfactory?


Dave



-
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 Framework Manual

2005-07-14 Thread Dave Newton

Rafael Taboada wrote:


Yeah, that was the problem...
Do u know a tutorial about how to fill my validation.xml?
I want to know what i have to put in each tag.
 

Are the docs at http://struts.apache.org/userGuide/dev_validator.html 
not satisfactory?


Dave



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



Re: Validation Framework Manual

2005-07-14 Thread Rafael Taboada
Yeah, that was the problem...
 Do u know a tutorial about how to fill my validation.xml?
 I want to know what i have to put in each tag.



-- 
Rafael Taboada
Software Engineer

Cell : +511-97753290

"No creo en el destino pues no me gusta tener la idea de controlar mi vida"


Re: Validation Framework Manual

2005-07-14 Thread Wendy Smoak
From: "Rafael Taboada" <[EMAIL PROTECTED]>

> java.lang.NoClassDefFoundError: antlr/TokenStream

That just looks like you're missing antlr.jar from the classpath.  Is it in
WEB-INF/lib?

-- 
Wendy Smoak


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



RE: Validation framework

2005-07-14 Thread Nitish Kumar


With no intentions to create yet another thread of "I dont like Validator
Framework". I just wanted to know if there was any way of using validation
framework to validate collections element, without writing
bean.collection[0].property for the property, as it might not be possible to
know the size of collection (else why would I use collection? )

To make it easier, a lot of times i have a collection of textboxes to be
populated with numbers, Is there any way of validating?

overriding validate() method of ActionForm, is not an option, as I am using
BeanValidatorForm. 


Thanks and Regards, 
Nitish Kumar 




-Original Message-
From: Borislav Sabev [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 14, 2005 3:34 PM
To: Struts Users Mailing List
Subject: Re: Validation framework


Rafael Taboada wrote:

>Hi folks I'm using validation framework in order to validate my fields in a

>form.
> I have three fields in a search form:
> strUsername
>strFromDate
>strToDate
> But we have the rule that the user can fill strUsername or use dates
range. 
>I mean he can search by username or he can search by dates range...
> When I use validation, it validates all the fields My question is how 
>can I set my search rule??? the user can search by username or by dates 
>range... If he choose username so validation only has to validate username 
>field... But if he choose dates range, so validation has to validate only 
>FromDate and ToDate...
> Any help would be appreciated...
> Thanks in advance.
>
>  
>
You have at least 3 choices:
1. client side validation i.e. to use javascript onSubmit to check such 
logic
2. write your own validator - see commons-validator for more info
3. validate it in the form.validate() metod
all 3 have +/- I recomend you the 3th method.

Regards
Borislav

-
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 framework

2005-07-14 Thread Borislav Sabev

Rafael Taboada wrote:

Hi folks I'm using validation framework in order to validate my fields in a 
form.

I have three fields in a search form:
strUsername
strFromDate
strToDate
But we have the rule that the user can fill strUsername or use dates range. 
I mean he can search by username or he can search by dates range...
When I use validation, it validates all the fields My question is how 
can I set my search rule??? the user can search by username or by dates 
range... If he choose username so validation only has to validate username 
field... But if he choose dates range, so validation has to validate only 
FromDate and ToDate...

Any help would be appreciated...
Thanks in advance.

 


You have at least 3 choices:
1. client side validation i.e. to use javascript onSubmit to check such 
logic

2. write your own validator - see commons-validator for more info
3. validate it in the form.validate() metod
all 3 have +/- I recomend you the 3th method.

Regards
Borislav

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



Re: Validation framework

2005-07-13 Thread ichy
Hi, Rafael.
 you can find clue on the following documentation.
http://struts.apache.org/userGuide/dev_validator.html
 check validwhen.
 ichy

 2005/7/14, Rafael Taboada <[EMAIL PROTECTED]>: 
> 
> Hi folks I'm using validation framework in order to validate my fields in 
> a
> form.
> I have three fields in a search form:
> strUsername
> strFromDate
> strToDate
> But we have the rule that the user can fill strUsername or use dates 
> range.
> I mean he can search by username or he can search by dates range...
> When I use validation, it validates all the fields My question is how
> can I set my search rule??? the user can search by username or by dates
> range... If he choose username so validation only has to validate username
> field... But if he choose dates range, so validation has to validate only
> FromDate and ToDate...
> Any help would be appreciated...
> Thanks in advance.
> 
> --
> Rafael Taboada
> Software Engineer
> 
> Cell : +511-97753290
> 
> "No creo en el destino pues no me gusta tener la idea de controlar mi 
> vida"
> 
>


Re: validation client-side. Problem with 2 submit buttons

2005-07-13 Thread Marc Demlenne
Nice trick. So simple I didn't thought about this. 
Thanks very much ! 

On 13/07/05, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>  
> 
> Instead of calling the return validateForm(this) function in the on submit,
> you could wrapper the check based on a JavaScript variable.
>  
>  var validate = true
>  
>  
>  
>  validate
>  don't validate
>  
>  
>  
>  
>  Marc Demlenne <[EMAIL PROTECTED]>
>  
>  
>  
>  
>  
>  
>  
> Marc Demlenne <[EMAIL PROTECTED]> 
> 
> 07/13/2005 11:30 AM 
> Please respond to
>  "Struts Users Mailing List"  
> 
>  
> To
>  Struts Users Mailing List , Rafael Taboada
> <[EMAIL PROTECTED]> 
> 
>  
> cc
>  
> 
>  
> Subject
>  Re: validation client-side. Problem with 2 submit buttons 
>  
>  
> I DO use struts validator framework ... 
>  
>  What i want is to to have _only_ one of the submit button to check the
>  client-side validation
>  
>  But I can only decide to call validator or not by form, not by button.
>  As it is for client side that I have this problem, I can't call it
>  from my modify method...
>  
>  On 13/07/05, Rafael Taboada <[EMAIL PROTECTED]> wrote:
>  > Hi, use Validator framework.
>  >  In this framework u can put code in order to set a client-side
> validation
>  > for each feld.
>  >  In ur modify method, call to ur validate method.
>  >  I hope it can help u
>  > 
>  > --
>  > Rafael Taboada
>  > Software Engineer
>  > 
>  > Cell : +511-97753290
>  > 
>  > "No creo en el destino pues no me gusta tener la idea de controlar mi
> vida"
>  > 
>  > 
>  
>  
>  -- 
>  Marc Demlenne
>  
> -
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
>  
>  
>  
> 
> 


-- 
Marc Demlenne

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



Re: validation client-side. Problem with 2 submit buttons

2005-07-13 Thread Jeff Beal
Sorry -- missed the 'client-side' bit somehow.  ;)

On 7/13/05, Jeff Beal <[EMAIL PROTECTED]> wrote:
> Set validation off in struts-config and call the Validate method from
> within your Action:
> 
> if (yourForm.getAction().equals("action_to_validate")) {
>   ActionErrors errors = form.validate(/*params*/);
>   if (errors.isEmpty()) {
> // all is good
>   } else {
> saveErrors(errors);
> return mapping.findInputForward();
>   }
> }
> 
> --Jeff
> 
> On 7/13/05, Marc Demlenne <[EMAIL PROTECTED]> wrote:
> > I DO use struts validator framework ...
> >
> > What i want is to to have _only_ one of the submit button to check the
> > client-side validation
> >
> > But I can only decide to call validator or not by form, not by button.
> > As it is for client side that I have this problem, I can't call it
> > from my modify method...
> >
> > On 13/07/05, Rafael Taboada <[EMAIL PROTECTED]> wrote:
> > > Hi, use Validator framework.
> > >  In this framework u can put code in order to set a client-side validation
> > > for each feld.
> > >  In ur modify method, call to ur validate method.
> > >  I hope it can help u
> > >
> > > --
> > > Rafael Taboada
> > > Software Engineer
> > >
> > > Cell : +511-97753290
> > >
> > > "No creo en el destino pues no me gusta tener la idea de controlar mi 
> > > vida"
> > >
> > >
> >
> >
> > --
> > Marc Demlenne
> >
> > -
> > 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 client-side. Problem with 2 submit buttons

2005-07-13 Thread BHansard

Instead of calling the return validateForm(this) function in the on submit, you could wrapper the check based on a _javascript_ variable.
<_javascript_>
var validate = true



validate
don't validate




Marc Demlenne <[EMAIL PROTECTED]>








Marc Demlenne <[EMAIL PROTECTED]> 
07/13/2005 11:30 AM

Please respond to
"Struts Users Mailing List" 








To
Struts Users Mailing List , Rafael Taboada <[EMAIL PROTECTED]>


cc



Subject
Re: validation client-side. Problem with 2 submit buttons








I DO use struts validator framework ... 

What i want is to to have _only_ one of the submit button to check the
client-side validation

But I can only decide to call validator or not by form, not by button.
As it is for client side that I have this problem, I can't call it
from my modify method...

On 13/07/05, Rafael Taboada <[EMAIL PROTECTED]> wrote:
> Hi, use Validator framework.
>  In this framework u can put code in order to set a client-side validation
> for each feld.
>  In ur modify method, call to ur validate method.
>  I hope it can help u
> 
> --
> Rafael Taboada
> Software Engineer
> 
> Cell : +511-97753290
> 
> "No creo en el destino pues no me gusta tener la idea de controlar mi vida"
> 
> 


-- 
Marc Demlenne

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





Re: validation client-side. Problem with 2 submit buttons

2005-07-13 Thread Jeff Beal
Set validation off in struts-config and call the Validate method from
within your Action:

if (yourForm.getAction().equals("action_to_validate")) {
  ActionErrors errors = form.validate(/*params*/);
  if (errors.isEmpty()) {
// all is good
  } else {
saveErrors(errors);
return mapping.findInputForward();
  }
}

--Jeff

On 7/13/05, Marc Demlenne <[EMAIL PROTECTED]> wrote:
> I DO use struts validator framework ...
> 
> What i want is to to have _only_ one of the submit button to check the
> client-side validation
> 
> But I can only decide to call validator or not by form, not by button.
> As it is for client side that I have this problem, I can't call it
> from my modify method...
> 
> On 13/07/05, Rafael Taboada <[EMAIL PROTECTED]> wrote:
> > Hi, use Validator framework.
> >  In this framework u can put code in order to set a client-side validation
> > for each feld.
> >  In ur modify method, call to ur validate method.
> >  I hope it can help u
> >
> > --
> > Rafael Taboada
> > Software Engineer
> >
> > Cell : +511-97753290
> >
> > "No creo en el destino pues no me gusta tener la idea de controlar mi vida"
> >
> >
> 
> 
> --
> Marc Demlenne
> 
> -
> 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 client-side. Problem with 2 submit buttons

2005-07-13 Thread Marc Demlenne
I DO use struts validator framework ... 

What i want is to to have _only_ one of the submit button to check the
client-side validation

But I can only decide to call validator or not by form, not by button.
As it is for client side that I have this problem, I can't call it
from my modify method...

On 13/07/05, Rafael Taboada <[EMAIL PROTECTED]> wrote:
> Hi, use Validator framework.
>  In this framework u can put code in order to set a client-side validation
> for each feld.
>  In ur modify method, call to ur validate method.
>  I hope it can help u
> 
> --
> Rafael Taboada
> Software Engineer
> 
> Cell : +511-97753290
> 
> "No creo en el destino pues no me gusta tener la idea de controlar mi vida"
> 
> 


-- 
Marc Demlenne

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



Re: validation client-side. Problem with 2 submit buttons

2005-07-13 Thread Rafael Taboada
Hi, use Validator framework.
 In this framework u can put code in order to set a client-side validation 
for each feld.
 In ur modify method, call to ur validate method.
 I hope it can help u

-- 
Rafael Taboada
Software Engineer

Cell : +511-97753290

"No creo en el destino pues no me gusta tener la idea de controlar mi vida"


Re: validation client-side. Problem with 2 submit buttons

2005-07-13 Thread BHansard

If you are using Validator, you can create a DynaForm.  then based on the action that you are calling, the validations can be different.  This will work for either client side or server side supposedly.  I have only used server side with it.
Marc Demlenne <[EMAIL PROTECTED]>








Marc Demlenne <[EMAIL PROTECTED]> 
07/13/2005 10:56 AM

Please respond to
"Struts Users Mailing List" 








To
Struts Users Mailing List 


cc



Subject
validation client-side. Problem with 2 submit buttons








Hello, 

Using struts validation framework, what's the best way to handle the
following case :

You have a simple form with 2 submit buttons. One for display, the
other to modify changes.
How to make the validation active only for modify button ? 
Server-side, you can simply have 2 actions name, one of them defined
as validate=true, the other as validate=false.
Is there a client-side equivalent ? 

Thanks a lot for any help. 

-- 
Marc Demlenne

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





Re: Validation problem

2005-07-12 Thread Rick Reumann

Rafael Taboada wrote the following on 7/11/2005 6:28 PM:

Thanks, I got it!...
 I needed to save the errors :)
 Rick Thanks for ur advice about using another class to manage JDBC... I'll 
review that... Do u know any samples about how to do that?..


Well typically I like to use the container managed connection pool. (If 
using Tomcat they have pretty simple docs on it.) The point is though to 
simply move that to another class. At the very least you'll want one 
other layer (typically a DAO layer) that takes care of doing your CRUD - 
-create,remove,update,delete stuff. This DAO layer is where you'd do the 
DB/JDBC stuff or if using something more slick like iBATIS/hibernate 
those call would do there also. So for an example updating an Employee


//In Action method:
execute(...) //or dispatchMethod update(..) {
  //cast to your ActionForm of String properties
  EmployeeActionForm eForm = (EmployeeActionForm)form;

  //business POJO with correct Data types
  EmployeeVO emp = new EmployeeVO();

  //easy to take the stuff from ActionForm to VO
  BeanUtils.copyProperties( emp, eForm );

  //Do the update
  yourEmployeeDAO.updateEmployee( emp );
}

I typically have one more layer before the dao, that I usually call a 
Service or Delegate (not using correct Design pattern terms I'm sure:) 
But anyway this way you can do several other business logic things and 
it even hides the dao part. So for example maybe besides doing an update 
to the DB you also needed to call an API to send out some e-mail 
notifications. This stuff I'd do in the service class...


//YourService
updateEmployee( EmployeeVO emp ) {
  //do the update
  yourDAO.updateEmployee( emp );
  //do some stuff or maybe some logic
  //like send out an email
}

//IN your Action it just changes from calling DAO to calling service
yourService.updateEmployee( emp );

If you take the above approach you'll keep your Actions pretty clean and 
easy to read and understand. Of course you might do some other stuff not 
shown the Action above like saving success messages, calling validation, 
saving some errors, some slight forwarding logic, etc. Point is to keep 
them clean though. If you aren't careful you'll end up with your Action 
classes doing too much business oriented tasks that can be better pushed 
off to another class.


--
Rick

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



Re: Validation problem

2005-07-12 Thread Borislav Sabev

Rafael Taboada wrote:


Hi folks, I'm doing my validation for my form fields...
I use validation framework, so I don't use validate method in my form bean.
The problem I have is the validate is called when I use for first time the 
module. I mean, when I see for frst ime the HTML form, validation is 
called... Why???
When I set validate attribute to false in my action mapping, validation is 
not called...

I want the validation is called only when the user click on submit button.
Did u have the same problem???
My Action extend DispatchAction class.
Thanks in advance.

 

Use 2 actions - one that shows the form and one that submit it, and 
validate the form ONLY on the second action (set the "validate" 
attribute in struts-config.xml to false or true respectively) This is a 
very common pattern in Struts.
If you use a DispatchAction (or derived from) to show and submit the 
form, than you have 2 choices:
1. the suggested upper (add just a smal forward action when you want to 
show the form)
2. recognize which "method" of the action (view or submit) is called - 
you can find it in the reuest, passed to validate() - and then make the 
validation only in case of submit.


Regards
Borislav


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

Re: Validation problem

2005-07-12 Thread Borislav Sabev

Rick Reumann wrote:



if ( errors != null && !errors.isEmpty ) <-- this part can probably be 
shortened, I was too lazy to figure out what really gets returned if 
validation passes.. a null or empty ActionErrors?




here is part of the code of RequestProcessor, so in both cases the form 
is considered valid

   ActionMessages errors = form.validate(mapping, request);
--->>>if ((errors == null) || errors.isEmpty()) {
   if (log.isTraceEnabled()) {
   log.trace("  No errors detected, accepting input");
   }
   return (true);
   }

Regards
Borislav

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

Re: Validation problem

2005-07-11 Thread Rafael Taboada
Thanks, I got it!...
 I needed to save the errors :)
 Rick Thanks for ur advice about using another class to manage JDBC... I'll 
review that... Do u know any samples about how to do that?..
 Thanks again

-- 
Rafael Taboada
Software Engineer

Cell : +511-97753290

"No creo en el destino pues no me gusta tener la idea de controlar mi vida"


Re: Validation problem

2005-07-11 Thread Michael Jouravlev
On 7/11/05, Rafael Taboada <[EMAIL PROTECTED]> wrote:
> Hi. When I turned off validation yn mi struts-config.xml, validation isn't
> called. And when I turned off validation and call validate manually inside a
> method of my ActionClass, validation isn't called.
>  I calle validate method in:
>  public ActionForward buscarColor(ActionMapping mapping, ActionForm
> form,HttpServletRequest request, HttpServletResponse response) {
> ...
> colorForm.validate(mapping,request);
> ...
> }
>  Maybe I'm calling this validate method in an incorrect way??

Hmm... It should be called. Are you sure that your validate in the
form overrides validate(ActionMapping mapping,
javax.servlet.http.HttpServletRequest request) and not this one
ActionErrors validate(ActionMapping mapping,
javax.servlet.ServletRequest request) ?

Put some debug output into your validate method as well before and
after your call to colorForm.validate(mapping,request), maybe this one
is not called.

Michael.

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



<    2   3   4   5   6   7   8   9   10   >