> 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?

...

> 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.

No. You have an action which shows item. It submits data to Save
Action. Save Action stores data in the database and redirects (not
forwards!) to the list. If you use redirect, you can reload your list
or do anything else.

The action which shows the list, must use session-scoped form bean (or
other session-scoped data), and store there the page number, if you
want to return to particular page. I am not sure what do you have to
do if you add or delete item, since you might need to repaginate.

Also read this: http://wiki.apache.org/struts/StrutsMultipleActionForms
You might like two action / two form approach. See example of Edit
Action and Save Action. Check out samle application here:
http://www.superinterface.com/rdapp/viewList.do Try to play with
Refrest/Back/Forward buttons. Try to resubmit the newly created item.

Michael.

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

Reply via email to