In your example I don't think you'd have that capability. In my chaining methodology I'd create a different action mapping pointing to the same Java Action and just have a different forward.
How would you accomplish this same thing?
Erik (with a "k")
V. Cekvenich wrote:
Eric, my actions do CRUD + default.
So I have onSave(), onDelete, onDisplay, onDefault, etc. on set of actions that relate to he JSP.
So in onDelete(EventObj event) I do this
{
..
bean.delete();
onDisplay(event); // on display does bean.find()
}
hth, .V
Erik Hatcher wrote:
Ted Husted wrote:the models are one layer deep. Talking with a Struts user, I was reminded of the ability of an action to forward to another action, and it's easier than I thought. Silly rabbit. :)Struts is not very powerful. There's no action chaining; all of
'nuff said.
Although, I'm among those who recommend against action-chaining, since it implies that there is too much business logic in the Action class. (The "chaining" should happen on the business tier.) But, there's nothing to prevent it (if you are wearing your bullet-proof shoes).
I'm one of those that find action-chaining very helpful. Here's an example of how/why I use it (all JSP's are under WEB-INF)
- A list view of all items
- A delete link by each of the items
- User clicks to delete an item
- DeleteAction deletes the item and wants to forward back to
the list view
- An action is needed to generate the list view dynamically
I simply chain the "success" forward of the "/delete" mapping to "/view.do".
I've yet to see a solution that doesn't blur the delete step with the generate list view step - and this forces actions to be tied to how its used in the GUI, which to me goes against what Struts is all about. Creating tiny actions that only do one single thing and then glue them together in struts-config is something I find very helpful.
Is there a cleaner way to do this without action chaining?
Erik
-- 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]>