The problem is, I use ValueList for the listing page, it will automaticaaly 
append the action=add when selecting the next/previous page.

so, after I add the record, it will go to the listing page (return 
(mapping.findForward("afflist"))), at the same time, it will append the 
action=add (base on the previous action)..

That means, whenever I did an add action, then go back to the listing page, 
whenever I click the Next/Previous, it will add another record, and keep adding.

I tried to do like this..
<forward name="myafflist" path="/Affiliations.action?execute=showlist" />   
 <forward name="afflist" path="/ad.affiliations.affiliations.screen" />   
 <forward name="addaff" path="/ad.affiliations.details.screen" />

In the add action, I forward to "myafflist" rather than the usual "afflist".. 
the listing page still append the action=add after I did the add action

http://localhost:7001/myweb/Affiliations.action?aff_name=h&remarks=h&pagingPage=2&year_joined=h&execute=list&execute=add&;

it sounds funny, but at least... it works now..

anyone any better idea?


----- Original Message ----- 
From: "Erik Weber" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Friday, April 22, 2005 10:48 AM
Subject: Re: Action call another action?


> That's the way I do it. If your Actions are light, as they should be, it 
> doesn't add a lot of code. Some redundant code is not a bad thing, it 
> can make things clearer. If you were to "chain" actions, then you'd be 
> going through the entire request processor chain again.
> 
> I think that Struts 1.3, with chain of responsibility implementation, 
> should allow chaining of actions without causing redundant processing, 
> but I can't say for sure (at least I hope it does).
> 
> Erik
> 
> 
> Yen wrote:
> 
>> Hi,
>>
>> I have an action which save the data into the database, after the 
>> saving, I would like to forward to the listing page, where I have 
>> another action doing the listing.
>>
>> Should I repeat the same listing method (method list) in the save 
>> action itself..? Or, is there any better way?
>>
>> Thanks for advanced.
>>
>> rgds,
>> Yen
>>
>> public ActionForward save(ActionMapping mapping, ActionForm form, 
>> HttpServletRequest request, HttpServletResponse response)
>> {
>>    method save..
>>    method list..
>>   return (mapping.findForward("afflist"));
>> }
>>
>> public ActionForward listing(ActionMapping mapping, ActionForm form, 
>> HttpServletRequest request, HttpServletResponse response)
>> {
>>    method list
>>   return (mapping.findForward("afflist"));
>> }
>>
>> ---------------------------------------------------------------------
>> 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