Results 1 to 6 of 6

Thread: Customize MultiActionController methods?

  1. #1
    Join Date
    Mar 2005
    Posts
    9

    Default Customize MultiActionController methods?

    Hello,

    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. #2
    Join Date
    Mar 2005
    Posts
    9

    Default

    shameless bump

  3. #3
    Join Date
    Mar 2005
    Posts
    9

    Default

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

  4. #4
    Join Date
    Feb 2005
    Location
    Warwickshire, UK
    Posts
    148

    Default

    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.
    Dave Hewitt
    ------------------
    Senior Systems Engineer
    OBJECTIVITY
    www.objectivity.co.uk

  5. #5
    Join Date
    Sep 2006
    Posts
    2

    Default 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>
    <property name="methodNameResolver">
    ...
    </property>
    </bean>

    <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. #6
    Join Date
    Sep 2006
    Posts
    2

    Default clarification

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

Similar Threads

  1. Replies: 5
    Last Post: Jan 23rd, 2008, 04:30 PM
  2. Replies: 2
    Last Post: Jul 11th, 2005, 03:53 PM
  3. Replies: 2
    Last Post: Mar 31st, 2005, 09:26 AM
  4. Replies: 2
    Last Post: Jan 28th, 2005, 05:39 PM
  5. Replies: 4
    Last Post: Nov 16th, 2004, 07:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •