Originally posted by David Yutzy:
What are you trying to accomplish by doing this? What scenario is causing you to have to split the logic in this way?
Thanks for the reply:
There are two kinds of action handler in the application:
1) Extending Action class
2) Extending ActionDispatch class
I have identified some common code used by all the action handler classes. Which will be put in base class.
If i have common base class 'BaseActionDispatch' extending ActionDispatch, for above two classes. Then classes which were earlier extending Action
class, now needs to provide following information,
1) 'parameter' attribute in the action element of the struts-config.xml file
2) the value of the 'parameter' and the method name needs to be appended to the url in every request send to the action handler classes.
Eg:
struts-config.xml
<action path="/test" type="MyDispatchAction" parameter="method" >
url:
<a href="testLog.do?method=test"> call DispatchAction</a>
This is required because the Base class is extending ActionDispatch, which makes it Mandatory to provide above 2 information.
But above 2 information is redundant for those classes which were earlier extending Action class, but they need to provide as they are now extending BaseActionDispatch class.
If i don't provide the first information. i get the following error
"DispatchAction - -DispatchMapping[/test] does not define a handler property"
(i am using in jdeveloper9.0.3)