Results 1 to 2 of 2

Thread: initBinder executes during a POST request

  1. #1
    Join Date
    Oct 2004
    Location
    Raleigh, NC
    Posts
    3

    Default initBinder executes during a POST request

    I have been tracing the workflow of my AbstractWizardFormController subclass and have noticed that the initBinder method is executed regardless of whether the request is GET or POST.

    According to the JavaDoc for the AbstractFormController,
    http://www.springframework.org/docs/api/index.html
    the workflow only mentions that this method is executed for a GET (i.e. a request for a new form) - Apparently it is executed for a POST as well (the doc doesn't say explicitly that it isn't executed during a POST)

    The issue is that I am instantiating and registering all my propertyEditors in this method and it is repeatedly executed. I figured that I would only need to register these editors once - when the form is initialized...

    Any comments or suggestions as to where to "actually" instantiate and register the propertyEditors properly with SpringMVC.

  2. #2
    Join Date
    Aug 2004
    Location
    Toulouse, France
    Posts
    148

    Default

    I think it is a good (and needed) thing to have property editors registered each time a request is coming. It may seems a waste of time but please remember that property editors aren't threadsafe and reusable components. So, there's a new binder object created wih each request I guess and you need to register to it fresh new property editors if you want your web application able to serve multiple client (you want it, don't it ?

    Olivier

Similar Threads

  1. OpenSessionInView and portlet support
    By garpinc2 in forum Web Flow
    Replies: 31
    Last Post: Apr 9th, 2010, 11:12 AM
  2. Replies: 17
    Last Post: Jan 2nd, 2007, 01:43 PM
  3. Hibernate Long Session Per Flow?
    By akw in forum Web Flow
    Replies: 21
    Last Post: Dec 12th, 2005, 08:06 PM
  4. Replies: 9
    Last Post: Nov 1st, 2005, 10:36 PM
  5. Loosing my SecureContext
    By sklakken in forum Security
    Replies: 3
    Last Post: Jul 21st, 2005, 01:44 PM

Posting Permissions

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