I have a question about action chaining in theory.

I'm not sure what you mean by action chaining, but I tend to want to make my actions as generic as possible so that they can be called multiple times.

For example, I worked on an app that did a lot of session work. So I would make a LoaderAction and a DoerAction. The loader would load an object into session and the doer would display or edit or delete or whatever.

I would end up with a struts-config.xml that looked something like:
<action type="LoaderAction">
<forward name="next" path="DoerAction"/>
</action>

And there would be one entry in struts-config.xml for each different kind of load and forward. So there might be LoaderActionForDelete, LoaderActionForEdit, etc etc.

This has made things easier for me and others on my team as we don't need to modify any code or to create a new action class to load up an object, etc etc.

Are you saying this is bad?

BAL

From: "Andrew Hill" <[EMAIL PROTECTED]>
Reply-To: <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: RE: how to call more than one Struts Action for a given HTTP request
Date: Mon, 27 Jan 2003 20:25:04 +0800

You are referring to Action chaining?
This is discouraged as it leads to all sorts of problems...

...but wheres the fun in that eh?

If you want to chain actions you can have the first actions actionForward
point at the next, etc...
Be aware that the RequestProcessor will repopulate the form from the request
for each action you forward to. (You can of course modify this behaviour by
overridding the RequestProcessor - which is pluggable - with you own
subclass of it).

However, as I mentioned, action chaining generally tends to be a bad idea,
and a perceived need for it can often indicate a flaw in your design.

-----Original Message-----
From: Souravmay Das [mailto:[EMAIL PROTECTED]]
Sent: Monday, 27 January 2003 20:14
To: [EMAIL PROTECTED]
Subject: how to call more than one Struts Action for a given HTTP
request


Hi All,
I have a question can we call more than one Struts action for a
HTTP Request. Do you have any idea how to do it. The basic idea of having
more than one Struts actions, is for getting more fine grained reusable
component.

With regards,
Sourav Das



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

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail


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

Reply via email to