On 4/20/06, Meenakshi Singh <[EMAIL PROTECTED]> wrote:

> Please help me.
>
> I am using this code in one of my action classes(dispatch actions)
>
> if(returnvalue==1) //return value is the value returned by the dao method
> after inserting the record into the database.
> {
> ActionForward fwd=new ActionForward();
> fwd.setpath(/App/BidPackageDashboard.do"?code+"tmcode);
> return fwd;
> }
>

The first thing I'd ask is "Are you sure you have to forward to
another from your existing action?" Typically, you do not have to do
this (although of course there are exceptions). So, for example what
is it that BidPackageDashboard.do is actually doing with the "code"
parameter?  Isn't it probably a business type of procedure? If so,
make sure you are isolating that out from your Action class. So in the
above.. you might have...

 if(returnvalue==1)  {
     myBusinessClass.doSomething( tmcode );
}

Remember you also can have that dispatch method return different
mapping forwards.. that dispatch method doesn't have to go to the same
resulting screen. So you might have...

if(returnvalue==1)  {
     myBusinessClass.doSomething( tmcode );
     return mapping.findForward("whatever");
} else {
    //something else
    return mapping.findForward('somethingelse");
}

So again, really think about whether you need to go from one action to another.

Lastly, if you do need to it (which from the above I doubt you need
to), I wouldn't do it in the Action class but simply still return as
usual but have your action-mapping forward to the new action. ie:

if(returnvalue==1)  {
     request.setAttribute("code",tmcode); //or you could store in session
     return mapping.findForward("whatever");
}

In action mapping...

<action
    ....>
<forward name="whatever" path="BidPackageDashboard.do"/>

--
Rick

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

Reply via email to