Thanks so very much!  I have found very little on how the Struts API can
actually be used in practice, and even less on struts-config.xml.  I
actually assumed that that is how it must be done.  That being said, I still
don't have a clue as to the actual implementation.  It sure would be nice if
the Jakarta folks would put together something along the lines of the
excellent tutorials available at java.sun.com!

Cheers!
Mark

----- Original Message -----
From: "Mark Woon" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, January 17, 2002 6:21 PM
Subject: Re: Action Passing a Class Instance?


> Mark Galbreath wrote:
>
> > Anyway, I need to pass control from one class to another in a web app
> > something like:
> >
> > public String getNextPage() throws Exception {
> >     Command nextCommand = new ListEquipmentAction();
> >     nextCommand.setAttributes( this);
> >     nextCommand.execute();
> >
> >     return nextCommand.getNextPage();
> >
> >
> > How do I go about doing this in the form:
> >
> > return( mapping.findForward( "success"));
>
> In your Action:
>
> public ActionForward perform(...) {
>
>     request.setAttribute(key, this);
>     return (mapping.findForward("success"));
> }
>
>
> The mapping "success" is defined in /WEB-INF/struts-config.xml.  The
mapping can
> point to another class (Action) that will do somethinng different.
>
>
> So basically when someone requests a page, your Action gets control, it
does
> some processing, sets whatever attributes it needs to set, and then
forwards
> control on to something else.  What that something else is defined in
> /WEB-INF/struts-config.xml.
>
> Hope that helps.  I'm sure the Struts gurus will chime in to clarify... ;)
>
> -Another Mark
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>



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

Reply via email to