You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Daniel Henry <da...@yahoo.com> on 2007/05/16 14:46:04 UTC

how I can I have validation skip for the first page load?

Hello,

I would like to allow my forms to load once before being validated.  
That is the form should only be validated upon submission, not on load.  
The way that I'm accomplishing this right now is by creating a separate 
action to load the form, however this is starting to clutter up the 
struts.xml file as the number of forms on my site grows.   Is there any 
other way?

Thanks for any help or ideas.

-Dan Henry

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


Re: how I can I have validation skip for the first page load?

Posted by Laurie Harper <la...@holoweb.net>.
Daniel Henry wrote:
> Dave Newton wrote:
>> --- Daniel Henry <da...@yahoo.com> wrote:
>>  
>>> I would like to allow my forms to load once before
>>> being validated.  That is the form should only be validated upon
>>> submission, not on load.  The way that I'm accomplishing this right 
>>> now is by
>>> creating a separate action to load the form, however this is starting to
>>> clutter up the struts.xml file as the number of forms on my site
>>> grows.   Is there any other way?
>>
>> I'm assuming S2 since you say struts.xml.
>>
>> The "input" result (among a few others) are
>> pre-configured to not be validated (see the validation
>> interceptor docs).
>>   
> Thank you Dave.
> 
> I am using s2.  However, I'm not sure how to implement this solution.  
> The validation interceptor runs before my Action, therefore I don't have 
> a chance to return "input."
> 
> -Dan Henry

The validation interceptor fires based on what you request, not based on 
what you return. The technique Dave's referring to is to create an 
action mapping with method='input' and a corresponding input() method in 
the action. You then load your form with a URL of the form 
...action!input.action. The interceptor knows not to validate a request 
that's routed to the 'input' method, so your form loads without 
validation. You then submit it to the action's normal execute() method 
(or some other method besides input) and validation occurs.

HTH,

L.


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


Re: how I can I have validation skip for the first page load?

Posted by Laurie Harper <la...@holoweb.net>.
Sounds like an unrelated issue to me. There's not enough information 
here to tell what the problem is. For example, what annotations did you 
configure? How did it not work? What did you do that did work? What does 
your configuration and action code look like?

Start a new thread with a complete description of the problem and 
hopefully someone will be able to see where the issue is.

L.

richard jackson wrote:
> I'm having a similar issue with S2 as well. When using the validation 
> xml it
> will work but when using annotations it does not. Any clues to this 
> would be
> help full.
> 
> Thanks
> Richard Jackson
> 
> On 5/16/07, Daniel Henry <da...@yahoo.com> wrote:
>>
>> Dave Newton wrote:
>> > --- Daniel Henry <da...@yahoo.com> wrote:
>> >
>> >> I would like to allow my forms to load once before
>> >> being validated.
>> >> That is the form should only be validated upon
>> >> submission, not on load.
>> >> The way that I'm accomplishing this right now is by
>> >> creating a separate
>> >> action to load the form, however this is starting to
>> >> clutter up the
>> >> struts.xml file as the number of forms on my site
>> >> grows.   Is there any
>> >> other way?
>> >>
>> >
>> > I'm assuming S2 since you say struts.xml.
>> >
>> > The "input" result (among a few others) are
>> > pre-configured to not be validated (see the validation
>> > interceptor docs).
>> >
>> > d.
>> >
>> >
>> >
>> >
>> >
>> ____________________________________________________________________________________ 
>>
>> > Looking for earth-friendly autos?
>> > Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
>> > http://autos.yahoo.com/green_center/
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > For additional commands, e-mail: user-help@struts.apache.org
>> >
>> >
>> >
>> Thank you Dave.
>>
>> I am using s2.  However, I'm not sure how to implement this solution.
>> The validation interceptor runs before my Action, therefore I don't have
>> a chance to return "input."
>>
>> -Dan Henry
>>
>> ---------------------------------------------------------------------
>> 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: how I can I have validation skip for the first page load?

Posted by richard jackson <rd...@gmail.com>.
I'm having a similar issue with S2 as well. When using the validation xml it
will work but when using annotations it does not. Any clues to this would be
help full.

Thanks
Richard Jackson

On 5/16/07, Daniel Henry <da...@yahoo.com> wrote:
>
> Dave Newton wrote:
> > --- Daniel Henry <da...@yahoo.com> wrote:
> >
> >> I would like to allow my forms to load once before
> >> being validated.
> >> That is the form should only be validated upon
> >> submission, not on load.
> >> The way that I'm accomplishing this right now is by
> >> creating a separate
> >> action to load the form, however this is starting to
> >> clutter up the
> >> struts.xml file as the number of forms on my site
> >> grows.   Is there any
> >> other way?
> >>
> >
> > I'm assuming S2 since you say struts.xml.
> >
> > The "input" result (among a few others) are
> > pre-configured to not be validated (see the validation
> > interceptor docs).
> >
> > d.
> >
> >
> >
> >
> >
> ____________________________________________________________________________________
> > Looking for earth-friendly autos?
> > Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
> > http://autos.yahoo.com/green_center/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> >
> Thank you Dave.
>
> I am using s2.  However, I'm not sure how to implement this solution.
> The validation interceptor runs before my Action, therefore I don't have
> a chance to return "input."
>
> -Dan Henry
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: how I can I have validation skip for the first page load?

Posted by Daniel Henry <da...@yahoo.com>.
Dave Newton wrote:
> --- Daniel Henry <da...@yahoo.com> wrote:
>   
>> I would like to allow my forms to load once before
>> being validated.  
>> That is the form should only be validated upon
>> submission, not on load.  
>> The way that I'm accomplishing this right now is by
>> creating a separate 
>> action to load the form, however this is starting to
>> clutter up the 
>> struts.xml file as the number of forms on my site
>> grows.   Is there any 
>> other way?
>>     
>
> I'm assuming S2 since you say struts.xml.
>
> The "input" result (among a few others) are
> pre-configured to not be validated (see the validation
> interceptor docs).
>
> d.
>
>
>
>  
> ____________________________________________________________________________________
> Looking for earth-friendly autos? 
> Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
> http://autos.yahoo.com/green_center/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>   
Thank you Dave.

I am using s2.  However, I'm not sure how to implement this solution.  
The validation interceptor runs before my Action, therefore I don't have 
a chance to return "input."

-Dan Henry

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


Re: how I can I have validation skip for the first page load?

Posted by Dave Newton <ne...@yahoo.com>.
--- Daniel Henry <da...@yahoo.com> wrote:
> I would like to allow my forms to load once before
> being validated.  
> That is the form should only be validated upon
> submission, not on load.  
> The way that I'm accomplishing this right now is by
> creating a separate 
> action to load the form, however this is starting to
> clutter up the 
> struts.xml file as the number of forms on my site
> grows.   Is there any 
> other way?

I'm assuming S2 since you say struts.xml.

The "input" result (among a few others) are
pre-configured to not be validated (see the validation
interceptor docs).

d.



 
____________________________________________________________________________________
Looking for earth-friendly autos? 
Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
http://autos.yahoo.com/green_center/

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