Announcement Announcement Module
No announcement yet.
Customize MultiActionController methods? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Customize MultiActionController methods?


    I searched but didn't find this answer. We'd like to customize the method signatures of all our MultiActionController methods. Basically, we want to grab a model object out of the session and have it as the third parameter of each method (after the request and response and before the command or session parameter).

    However, the setDelegate( ) and invokeNamedMethod( ) methods (where the methods are cached and invoked respectively) are both final. So I can't override them to provide any custom behavior. Am I missing something? Is this impossible?

    Thanks for any help!

    - Dan

  • #2
    shameless bump


    • #3
      No answer? Have I stumbled upon some particularly non-configurable part of Spring?


      • #4
        I have encountered exactly this problem. I didn't think there was a way of acheiving this without duplicating, and then modifying, all of MultiActionController. It really wants a separate, extensible strategy for picking a method by signature and executing it.


        • #5
          re setDelegate(Object) being final...

          I had the same problem mentioned in this thread re setDelegate() being final.
          I looked at the Spring 2.0 api doc and the method is final there as well, so
          apparently the intent is for it to be final. In the api doc it says:
          "This method does not get invoked once the class is configured."
          That told me that it needs to be set via the configuration file.
          I tried that with:

          <bean id="myMultiActionController" class="ww.web.MyMultiActionController">
          <property name="delegate">
          <ref local="testDelegate"/>
          <property name="methodNameResolver">

          <bean id="testDelegate" class="ww.web.TestDelegate"/>

          and was able to see a method defined in TestDelegate get called
          by my MultiActionController.

          Bill Rishel


          • #6

            Clarification: per the Spring 2.0 Api doc you would not subclass MultiFormController if using a delegate.