Marco:

I'm not quite sure what you find distasteful about how dispatch action is working; is it simply that you think the request parameter values are not controlled enough to be good for use as bean names?

Maybe the problem is that you've been caught where the DispatchChainAction class hasn't been fully updated for Struts 1.3 and chain. It was ported in from the struts-chain sandbox implementation, but it was never upgraded to deal with the idea of multiple catalogs.

I had mostly skipped that because I wasn't sure who was using it, and because I have a bit of a sense that a ChainAction is obsolete now that you can specify a command directly on an ActionMapping. Maybe as we talk through your situation, we can work out whether the right solution is to "fix" DispatchChainAction, or to introduce a useful generic Command which does what you want.

If this isn't what bothers you about your current solution, please clarify. If it is what bothers you, we can work out the possible routes.

Joe



At 1:52 PM +0100 4/22/05, Marco Mistroni wrote:
Hello all,
I am writing a small application using struts 1.3
And commons-chain.
Currently, I have defined a BaseAction class which retrieves
Commands dynamically based on the path used
For example, calling /login will result in the action
Retrieving the command called /login String name = mapping.getPath();
System.out.println("Retrieving command for action"+ name);
Command command = catalog.getCommand(name);


That works fine (or eventually can be improved, as suggested here
http://wiki.apache.org/jakarta-commons/CommonsChainAndSpringFramework

But, what if my action extends DispatchAction?

Best htat I could do was to create a BaseDispatchAction that retrieves
The command based on the parameter that triggers Dispatch's action
specific method.
That results in a code like this :

String name = mapping.getParameter();
String command = request.getParameter(name);
Command command = catalog.getCommand(name);


Question: what's the best strategy to use for retrieving commands For a DispatchAction? Are there better (I hope) alternatives?

Any comments are welcome...

Thanx in advance and regards
        marco





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


--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "Narrow minds are weapons made for mass destruction" -The Ex


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



Reply via email to