Results 1 to 4 of 4

Thread: how to add custom object/bean to a controller method

  1. #1
    Join Date
    Mar 2008
    Posts
    20

    Question how to add custom object/bean to a controller method

    I have a multiaction controller which has custom methods doSomething(request,response,bean) .... so if i want to have a bean passed as the third parameter which is not a value object, how do i do tht?

    i had already overriden few methods in multi action controller ... but i need to get hold of request object to create this bean.

    So do handler interceptors provide any of this? or should i use aop for this?

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    You cannot, the method syntax of the MultiActionControllers are quite limited. You might want to take a look at the new @Controller stuff...
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Mar 2008
    Posts
    20

    Default

    Hello Marten,

    Thanks for the response.

    but i have read in spring best practices that annotation based wiring should be avoided.as it might cause confusion. Is this true?

    What would you prefer to use MultiActionController or Annotation based controllers.

    Many thanks
    Srikanth N

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    I wasn't talking about annotation based wiring! I was talking about annotated controllers (@Controller) which is something completly different. You don't have to use annotations to wire those @controllers although you can.

    @Controller is more powerfull than MAC, so I would prefer that one.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Posting Permissions

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