You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Lee Harrington <le...@gmail.com> on 2004/11/24 14:48:58 UTC

Post Validation

I'm using DynaValidator forms.  Works great, except when you have pick
lists and a validation fails.  When the validation fails, it calls the
form, but the code that puts the pick lists in the request scope isn't
rerun.

No biggie....I put my lists in the session scope.

However, I don't want them hanging around forever.  Wondering if there
is a "post Validate" section somewhere that I could put code in to
destroy the session variables.

Better yet, a "preForm" section that is run even when Validate fails
so I could populate the lists in that scenario.

Lee

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


Re: Post Validation

Posted by Lee Harrington <le...@gmail.com>.
Ok....what is your solution to the problem of Validation?

Lee


On Wed, 24 Nov 2004 13:13:13 -0500, David G. Friedman
<hu...@ix.netcom.com> wrote:
> Bill,
> 
> I understand it might be lightweight but that message, to me, say that at
> that time, calling an action from another action still results in Struts
> reprocessing the request (all of it).  I haven't heard anything about any
> code in production which would prevent the additional re-processing of the
> original request when an action calls another action (i.e. as a forward or
> perhaps an input="" attribute).  After re-checking the release notes, I
> still don't see anything like that.
> 
> I just wanted you and Lee not to forget there is a complete re-processing of
> the request when you use that design philosophy.
> 
> Regards,
> David
> 
> ---
> Save CPU, use Tiles Controllers! LOL.
> 
> 
> 
> -----Original Message-----
> From: news [mailto:news@sea.gmane.org]On Behalf Of Bill Siggelkow
> Sent: Wednesday, November 24, 2004 12:56 PM
> To: user@struts.apache.org
> Subject: Re: Post Validation
> 
> Well, the type of action I am talking about is usually pretty
> lightweight -- a view helper -- that simply sets up the request and
> forwards to the view -- but doesn't do a lot of "business" stuff.  Check
> out this thread from the archives:
> http://www.mail-archive.com/struts-user@jakarta.apache.org/msg82653.html
> 
> -Bill Siggelkow
> 
> David G. Friedman wrote:
> 
> > Bill,
> >
> > Isn't setting the input to another action sort of a bad idea?  Wouldn't
> that
> > cause the framework to start all over internally - request processing
> > everything from scratch and all that?  Wouldn't forwarding to a tile with
> a
> > tiles controller work better (i.e. less processing power) in that
> situation?
> >
> > Regards,
> > David
> >
> > -----Original Message-----
> > From: news [mailto:news@sea.gmane.org]On Behalf Of Bill Siggelkow
> > Sent: Wednesday, November 24, 2004 9:37 AM
> > To: user@struts.apache.org
> > Subject: Re: Post Validation
> >
> >
> > You're on the right path, Lee. Instead of setting the "input" to the
> > JSP, set it to an action, which creates your pick lists and stuffs them
> > in the request, that precedes the JSP.
> >
> > -Bill Siggelkow
> >
> > Lee Harrington wrote:
> >
> >
> >>I'm using DynaValidator forms.  Works great, except when you have pick
> >>lists and a validation fails.  When the validation fails, it calls the
> >>form, but the code that puts the pick lists in the request scope isn't
> >>rerun.
> >>
> >>No biggie....I put my lists in the session scope.
> >>
> >>However, I don't want them hanging around forever.  Wondering if there
> >>is a "post Validate" section somewhere that I could put code in to
> >>destroy the session variables.
> >>
> >>Better yet, a "preForm" section that is run even when Validate fails
> >>so I could populate the lists in that scenario.
> >>
> >>Lee
> >
> 
> ---------------------------------------------------------------------
> 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: Post Validation

Posted by "David G. Friedman" <hu...@ix.netcom.com>.
Bill,

I understand it might be lightweight but that message, to me, say that at
that time, calling an action from another action still results in Struts
reprocessing the request (all of it).  I haven't heard anything about any
code in production which would prevent the additional re-processing of the
original request when an action calls another action (i.e. as a forward or
perhaps an input="" attribute).  After re-checking the release notes, I
still don't see anything like that.

I just wanted you and Lee not to forget there is a complete re-processing of
the request when you use that design philosophy.

Regards,
David

---
Save CPU, use Tiles Controllers! LOL.

-----Original Message-----
From: news [mailto:news@sea.gmane.org]On Behalf Of Bill Siggelkow
Sent: Wednesday, November 24, 2004 12:56 PM
To: user@struts.apache.org
Subject: Re: Post Validation


Well, the type of action I am talking about is usually pretty
lightweight -- a view helper -- that simply sets up the request and
forwards to the view -- but doesn't do a lot of "business" stuff.  Check
out this thread from the archives:
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg82653.html

-Bill Siggelkow

David G. Friedman wrote:

> Bill,
>
> Isn't setting the input to another action sort of a bad idea?  Wouldn't
that
> cause the framework to start all over internally - request processing
> everything from scratch and all that?  Wouldn't forwarding to a tile with
a
> tiles controller work better (i.e. less processing power) in that
situation?
>
> Regards,
> David
>
> -----Original Message-----
> From: news [mailto:news@sea.gmane.org]On Behalf Of Bill Siggelkow
> Sent: Wednesday, November 24, 2004 9:37 AM
> To: user@struts.apache.org
> Subject: Re: Post Validation
>
>
> You're on the right path, Lee. Instead of setting the "input" to the
> JSP, set it to an action, which creates your pick lists and stuffs them
> in the request, that precedes the JSP.
>
> -Bill Siggelkow
>
> Lee Harrington wrote:
>
>
>>I'm using DynaValidator forms.  Works great, except when you have pick
>>lists and a validation fails.  When the validation fails, it calls the
>>form, but the code that puts the pick lists in the request scope isn't
>>rerun.
>>
>>No biggie....I put my lists in the session scope.
>>
>>However, I don't want them hanging around forever.  Wondering if there
>>is a "post Validate" section somewhere that I could put code in to
>>destroy the session variables.
>>
>>Better yet, a "preForm" section that is run even when Validate fails
>>so I could populate the lists in that scenario.
>>
>>Lee
>


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


Re: Post Validation

Posted by Bill Siggelkow <bi...@bellsouth.net>.
Well, the type of action I am talking about is usually pretty 
lightweight -- a view helper -- that simply sets up the request and 
forwards to the view -- but doesn't do a lot of "business" stuff.  Check 
out this thread from the archives: 
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg82653.html

-Bill Siggelkow

David G. Friedman wrote:

> Bill,
> 
> Isn't setting the input to another action sort of a bad idea?  Wouldn't that
> cause the framework to start all over internally - request processing
> everything from scratch and all that?  Wouldn't forwarding to a tile with a
> tiles controller work better (i.e. less processing power) in that situation?
> 
> Regards,
> David
> 
> -----Original Message-----
> From: news [mailto:news@sea.gmane.org]On Behalf Of Bill Siggelkow
> Sent: Wednesday, November 24, 2004 9:37 AM
> To: user@struts.apache.org
> Subject: Re: Post Validation
> 
> 
> You're on the right path, Lee. Instead of setting the "input" to the
> JSP, set it to an action, which creates your pick lists and stuffs them
> in the request, that precedes the JSP.
> 
> -Bill Siggelkow
> 
> Lee Harrington wrote:
> 
> 
>>I'm using DynaValidator forms.  Works great, except when you have pick
>>lists and a validation fails.  When the validation fails, it calls the
>>form, but the code that puts the pick lists in the request scope isn't
>>rerun.
>>
>>No biggie....I put my lists in the session scope.
>>
>>However, I don't want them hanging around forever.  Wondering if there
>>is a "post Validate" section somewhere that I could put code in to
>>destroy the session variables.
>>
>>Better yet, a "preForm" section that is run even when Validate fails
>>so I could populate the lists in that scenario.
>>
>>Lee
> 
> 
> 
> ---------------------------------------------------------------------
> 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: Post Validation

Posted by "David G. Friedman" <hu...@ix.netcom.com>.
Bill,

Isn't setting the input to another action sort of a bad idea?  Wouldn't that
cause the framework to start all over internally - request processing
everything from scratch and all that?  Wouldn't forwarding to a tile with a
tiles controller work better (i.e. less processing power) in that situation?

Regards,
David

-----Original Message-----
From: news [mailto:news@sea.gmane.org]On Behalf Of Bill Siggelkow
Sent: Wednesday, November 24, 2004 9:37 AM
To: user@struts.apache.org
Subject: Re: Post Validation


You're on the right path, Lee. Instead of setting the "input" to the
JSP, set it to an action, which creates your pick lists and stuffs them
in the request, that precedes the JSP.

-Bill Siggelkow

Lee Harrington wrote:

> I'm using DynaValidator forms.  Works great, except when you have pick
> lists and a validation fails.  When the validation fails, it calls the
> form, but the code that puts the pick lists in the request scope isn't
> rerun.
>
> No biggie....I put my lists in the session scope.
>
> However, I don't want them hanging around forever.  Wondering if there
> is a "post Validate" section somewhere that I could put code in to
> destroy the session variables.
>
> Better yet, a "preForm" section that is run even when Validate fails
> so I could populate the lists in that scenario.
>
> Lee


---------------------------------------------------------------------
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: Post Validation

Posted by Bill Siggelkow <bi...@bellsouth.net>.
You're on the right path, Lee. Instead of setting the "input" to the 
JSP, set it to an action, which creates your pick lists and stuffs them 
in the request, that precedes the JSP.

-Bill Siggelkow

Lee Harrington wrote:

> I'm using DynaValidator forms.  Works great, except when you have pick
> lists and a validation fails.  When the validation fails, it calls the
> form, but the code that puts the pick lists in the request scope isn't
> rerun.
> 
> No biggie....I put my lists in the session scope.
> 
> However, I don't want them hanging around forever.  Wondering if there
> is a "post Validate" section somewhere that I could put code in to
> destroy the session variables.
> 
> Better yet, a "preForm" section that is run even when Validate fails
> so I could populate the lists in that scenario.
> 
> Lee


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


Re: Post Validation

Posted by Guillaume Cottenceau <gc...@mnc.ch>.
Lee Harrington <leebase 'at' gmail.com> writes:

> I'm using DynaValidator forms.  Works great, except when you have pick

[...]

Please don't hit "answer" on a random message in your email
program when you want to start a new thread. Your email program
keeps track of what message it thinks you were answering (the
References: header) in the email you send, therefore it appears
inside the appropriate thread when we receive the message,
instead of at top of a new thread, which is misleading.

-- 
Guillaume Cottenceau

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