You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Anjib Mulepati <an...@hotmail.com> on 2010/12/30 17:09:54 UTC

Precedence

When using both validation.xml and validate() method for form validation 
which one have precedence?

Anjib

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Precedence

Posted by st...@gmail.com.
Do you need to write the method called super()?  I Couldn't resist

S

On Thu, Dec 30, 2010 at 4:29 PM, Dave Newton <da...@gmail.com> wrote:

> So, what might happen if you called it (super()) in validate()?
>
> I mean, I apologize for not just outright telling you, but I really like it
> when people puzzle through stuff like this themselves, because it is *the*
> most important skill you can have as a developer (or anything else, for
> that
> matter).
>
> (I also might be *totally* wrong, in which case sorry I confused the
> issue--my bad.)
>
> Dave
>
> On Thu, Dec 30, 2010 at 5:13 PM, Anjib Mulepati <an...@hotmail.com>
> wrote:
>
> > The reason I want to do it in two place is I am hoping I can do simple
> > validation in xml file and other custom validation in validate() method.
> > This is all because in my file uploading program if I try to upload large
> > file  I get null in other text box which otherwise works fine with
> smaller
> > file.
> >
> > Anjib
> >
> >
> > On 12/30/2010 2:03 PM, Dave Newton wrote:
> >
> >> ...
> >>
> >> So, what might happen if you called it in validate()?
> >>
> >> Dave
> >>
> >> On Thu, Dec 30, 2010 at 2:01 PM, Anjib Mulepati<an...@hotmail.com>
> >>  wrote:
> >>
> >>  Not in validate but in constructor.
> >>>
> >>> On 12/30/2010 1:56 PM, Dave Newton wrote:
> >>>
> >>>  Are you calling super() in your validate() method?
> >>>>
> >>>> On Thu, Dec 30, 2010 at 1:38 PM, Anjib Mulepati<an...@hotmail.com>
> >>>>  wrote:
> >>>>
> >>>>  I am using 1.3.8. I try with simple one and seems that validate() has
> >>>> the
> >>>>
> >>>>> precedence. In fact rules in .xml file is never checked even my class
> >>>>> is
> >>>>> extended from ValidatorForm.
> >>>>>
> >>>>>  Do you call super () (S1)?
> >>>>>
> >>>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >>> For additional commands, e-mail: user-help@struts.apache.org
> >>>
> >>>
> >>>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>

Re: Precedence

Posted by Dave Newton <da...@gmail.com>.
So, what might happen if you called it (super()) in validate()?

I mean, I apologize for not just outright telling you, but I really like it
when people puzzle through stuff like this themselves, because it is *the*
most important skill you can have as a developer (or anything else, for that
matter).

(I also might be *totally* wrong, in which case sorry I confused the
issue--my bad.)

Dave

On Thu, Dec 30, 2010 at 5:13 PM, Anjib Mulepati <an...@hotmail.com> wrote:

> The reason I want to do it in two place is I am hoping I can do simple
> validation in xml file and other custom validation in validate() method.
> This is all because in my file uploading program if I try to upload large
> file  I get null in other text box which otherwise works fine with smaller
> file.
>
> Anjib
>
>
> On 12/30/2010 2:03 PM, Dave Newton wrote:
>
>> ...
>>
>> So, what might happen if you called it in validate()?
>>
>> Dave
>>
>> On Thu, Dec 30, 2010 at 2:01 PM, Anjib Mulepati<an...@hotmail.com>
>>  wrote:
>>
>>  Not in validate but in constructor.
>>>
>>> On 12/30/2010 1:56 PM, Dave Newton wrote:
>>>
>>>  Are you calling super() in your validate() method?
>>>>
>>>> On Thu, Dec 30, 2010 at 1:38 PM, Anjib Mulepati<an...@hotmail.com>
>>>>  wrote:
>>>>
>>>>  I am using 1.3.8. I try with simple one and seems that validate() has
>>>> the
>>>>
>>>>> precedence. In fact rules in .xml file is never checked even my class
>>>>> is
>>>>> extended from ValidatorForm.
>>>>>
>>>>>  Do you call super () (S1)?
>>>>>
>>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Precedence

Posted by Anjib Mulepati <an...@hotmail.com>.
The reason I want to do it in two place is I am hoping I can do simple 
validation in xml file and other custom validation in validate() method.
This is all because in my file uploading program if I try to upload 
large file  I get null in other text box which otherwise works fine with 
smaller file.

Anjib

On 12/30/2010 2:03 PM, Dave Newton wrote:
> ...
>
> So, what might happen if you called it in validate()?
>
> Dave
>
> On Thu, Dec 30, 2010 at 2:01 PM, Anjib Mulepati<an...@hotmail.com>  wrote:
>
>> Not in validate but in constructor.
>>
>> On 12/30/2010 1:56 PM, Dave Newton wrote:
>>
>>> Are you calling super() in your validate() method?
>>>
>>> On Thu, Dec 30, 2010 at 1:38 PM, Anjib Mulepati<an...@hotmail.com>
>>>   wrote:
>>>
>>>   I am using 1.3.8. I try with simple one and seems that validate() has the
>>>> precedence. In fact rules in .xml file is never checked even my class is
>>>> extended from ValidatorForm.
>>>>
>>>>   Do you call super () (S1)?
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Precedence

Posted by Dave Newton <da...@gmail.com>.
...

So, what might happen if you called it in validate()?

Dave

On Thu, Dec 30, 2010 at 2:01 PM, Anjib Mulepati <an...@hotmail.com> wrote:

> Not in validate but in constructor.
>
> On 12/30/2010 1:56 PM, Dave Newton wrote:
>
>> Are you calling super() in your validate() method?
>>
>> On Thu, Dec 30, 2010 at 1:38 PM, Anjib Mulepati<an...@hotmail.com>
>>  wrote:
>>
>>  I am using 1.3.8. I try with simple one and seems that validate() has the
>>> precedence. In fact rules in .xml file is never checked even my class is
>>> extended from ValidatorForm.
>>>
>>>  Do you call super () (S1)?
>>>>>>
>>>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Precedence

Posted by Anjib Mulepati <an...@hotmail.com>.
Not in validate but in constructor.
On 12/30/2010 1:56 PM, Dave Newton wrote:
> Are you calling super() in your validate() method?
>
> On Thu, Dec 30, 2010 at 1:38 PM, Anjib Mulepati<an...@hotmail.com>  wrote:
>
>> I am using 1.3.8. I try with simple one and seems that validate() has the
>> precedence. In fact rules in .xml file is never checked even my class is
>> extended from ValidatorForm.
>>
>>>>> Do you call super () (S1)?


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Precedence

Posted by Dave Newton <da...@gmail.com>.
Are you calling super() in your validate() method?

On Thu, Dec 30, 2010 at 1:38 PM, Anjib Mulepati <an...@hotmail.com> wrote:

> I am using 1.3.8. I try with simple one and seems that validate() has the
> precedence. In fact rules in .xml file is never checked even my class is
> extended from ValidatorForm.
>
> >>>Do you call super () (S1)?
>>
>

Re: Precedence

Posted by Anjib Mulepati <an...@hotmail.com>.
I am using 1.3.8. I try with simple one and seems that validate() has 
the precedence. In fact rules in .xml file is never checked even my 
class is extended from ValidatorForm.

Anjib
On 12/30/2010 12:39 PM, Dave Newton wrote:
> Which version of struts? Do you call super () (S1)? Did you just try it?
> On Dec 30, 2010 11:10 AM, "Anjib Mulepati"<an...@hotmail.com>  wrote:
>> When using both validation.xml and validate() method for form validation
>> which one have precedence?
>>
>> Anjib
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Precedence

Posted by Dave Newton <da...@gmail.com>.
Which version of struts? Do you call super () (S1)? Did you just try it?
On Dec 30, 2010 11:10 AM, "Anjib Mulepati" <an...@hotmail.com> wrote:
> When using both validation.xml and validate() method for form validation
> which one have precedence?
>
> Anjib
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>