The information which exists in the query string is just string values.
The correpsonding parameter names can be defined in the form.
When invoked, Struts will populate the form and pass it on to the action
class. The action class extracts the values from the form and passes them
to the business logic. The business logic does its thing and returns some
values to the action class. The action class then uses these values to 
decide where to send the user.

robert

> -----Original Message-----
> From: news [mailto:[EMAIL PROTECTED] Behalf Of Muhammad Momin Rashid
> Sent: Saturday, July 24, 2004 7:54 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Form Bean and decions based on Business Logic calls
> 
> 
> Ok, I guess thats fair enough to keep business logic calls limited to action
> classes only.
> 
> How do you suggest I impliemnt the case where the user is supposed to
> directly land on a URL, and some information from business logic is
> required.
> 
> e.g the case where user clicks on a forgot password email sent to him/her.
> Here the information embeded in the URL needs to be sent to the Business
> Logic for processing.  Based on information returned by the Business Logic
> the user is allowed to proceed to reset password or not.
> 
> Regards,
> Muhammad Momin Rashid
> 
> "Robert Taylor" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > As Jim already mentioned, its best to keep the form beans as simple as
> possible
> > and void of logic.
> >
> > Place calls to business logic or delegates in the action class.
> >
> > robert
> >
> > > -----Original Message-----
> > > From: news [mailto:[EMAIL PROTECTED] Behalf Of Muhammad Momin Rashid
> > > Sent: Thursday, July 22, 2004 12:30 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: Re: Form Bean and decions based on Business Logic calls
> > >
> > >
> > > Thank you for your quick response.
> > >
> > > I do have the appropriate action class with the desired forwards defined
> (as
> > > you have also outlined), but the problem is that the form bean itself is
> > > making the business logic calls to get its desired data.  Upon failure
> to
> > > get the desired data, how can I forward to a different page?  Keeping in
> > > mind that the decision to forward to an failure action is to be done
> within
> > > the Form Bean here.
> > >
> > > I am also interested in knowing if this is the correct approach to have
> the
> > > form bean make such calls.  If not, then kindly suggest a better
> > > implementation.
> > >
> > > Regards,
> > > Muhammad Momin Rashid.
> > >
> > > "Robert Taylor" <[EMAIL PROTECTED]> wrote in message
> > > news:[EMAIL PROTECTED]
> > > > Define success and failure forwards in your struts-config file for the
> > > > specified action.
> > > >
> > > > In the action class (which should delegate to a business object),
> > > > retrieve the data. Upon failure, forward to the "failure" forward,
> > > > else forward to the "success" forward.
> > > >
> > > > You could achieve the same using declarative exceptions.
> > > >
> > > > If the list of countries doesn't vary between users, you
> > > > can do this when your application starts up and place the
> > > > country list in ServletContext. In this fashion, you only
> > > > have a single database hit for getting the countries.
> > > >
> > > > robert
> > > >
> > > > > -----Original Message-----
> > > > > From: news [mailto:[EMAIL PROTECTED] Behalf Of Muhammad Momin
> Rashid
> > > > > Sent: Thursday, July 22, 2004 10:38 AM
> > > > > To: [EMAIL PROTECTED]
> > > > > Subject: Form Bean and decions based on Business Logic calls
> > > > >
> > > > >
> > > > > Hello,
> > > > >
> > > > > I have a form bean which needs to retrieve some information from the
> > > > > business logic.  I want to know how I can redirect to different
> pages on
> > > the
> > > > > bases of data retrieved.
> > > > >
> > > > > e.g. I need to retrieve and display a list of countries for the user
> to
> > > > > select from.  In case of failure to retrieve the information I would
> > > like to
> > > > > take user to a different page to indicate error.
> > > > >
> > > > > What would be the best way to accomplish this?  I am using struts
> 1.1
> > > with
> > > > > Tiles.
> > > > >
> > > > > Regards,
> > > > > Muhammad Momin Rashid
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > ---------------------------------------------------------------------
> > > > > 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]

Reply via email to