Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Quick MultiActionController question

  1. #11
    Join Date
    Aug 2004
    Posts
    1,905

    Default

    Quote Originally Posted by Aramir
    Yep, ParameterMethodNameResolver.setDefaultMethodName() already does that: "Set the name of the default handler method that should be used when no parameter was found in the request"
    That is slightly different

    The OP wanted a method to be executed if there wasn't a method which matched the *value of the specified parameter* (i.e. ?methodName=noSuchMethod&param1=value1).

    Code:
    ParameterMethodNameResolver.setDefaultMethodName()
    sets the method to be executed if the specified parameter has *no value*.

    Maybe setDefaultMethodName will work for both. Not sure

  2. #12
    Join Date
    Mar 2006
    Posts
    11

    Default

    Quote Originally Posted by yatesco
    Maybe setDefaultMethodName will work for both. Not sure
    Nah, you're right, my mistake. It only works if there is no parameter. Will throw this no-method-found-exception if the paramether is there but with a wrong method name.

    However, - this is good, I think. We already lost compile-time checking for missing methods with this model. To loose a runtime checking by not throwing exceptions but falling back to a default method, that would be a *huge* hole for errors. Not good..

  3. #13
    Join Date
    Aug 2004
    Posts
    1,905

    Default

    Quote Originally Posted by Aramir
    We already lost compile-time checking for missing methods with this model. To loose a runtime checking by not throwing exceptions but falling back to a default method, that would be a *huge* hole for errors. Not good..
    I absolutely agree with you

    I personally do not like MAC purely because of this looseness of binding. I think it is much better to explicitly map URLs to functional areas, even it is a bit more config.... those "simple" usecases always get a little bit more complex anyway

Posting Permissions

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