Results 1 to 5 of 5

Thread: Question about FilterInvocationDefinitionSourceEditor

  1. #1
    Join Date
    Aug 2004
    Location
    New York, NY
    Posts
    46

    Default Question about FilterInvocationDefinitionSourceEditor

    Sorry to ask such a basic question but I guess I must not understand PropertyEditors as well as I once thought. How does the FilterInvocationDefinitionSourceEditor class get registered? Or more approriately, how does Spring know to use it when building up the ObjectDefinitionSource property of the FilterSecurityInterceptor? I thought customer editors had to be registered but I don't see anywhere where this class gets registered.

    Thanks,
    Patrick

  2. #2
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    AFAIK custom editors for the application context don't need to be registered if they're named the same as the required type and end with "Editor". So as FilterSecurityInterceptor uses FilterInvocationDefinitionSource as its objectDefinitionSource, FilterInvocationDefinitionSourceEditor gets called.

  3. #3
    Join Date
    Aug 2004
    Location
    New York, NY
    Posts
    46

    Default

    Thanks for the clarification Ben. I'm guessing that's a feature of the Spring BeanFactory?

    Thanks,
    Patrick

  4. #4
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    Spring Reference Guide states:

    Spring uses the java.beans.PropertyEditorManager to set the search-path for property editors that might be
    needed. The search-path also includes sun.bean.editors, which includes PropertyEditors for Font, Color and
    all the primitive types.
    The JavaDocs for PropertyEditorManager states:

    The PropertyEditorManager uses three techniques for locating an editor for a given type. First, it provides a registerEditor method to allow an editor to be specifically registered for a given type. Second it tries to locate a suitable class by adding "Editor" to the full qualified classname of the given type (e.g. "foo.bah.FozEditor"). Finally it takes the simple classname (without the package name) adds "Editor" to it and looks in a search-path of packages for a matching class.

  5. #5
    Join Date
    Aug 2004
    Location
    New York, NY
    Posts
    46

    Default

    Thank you Ben..Features of Spring are always showing up. That's a pretty cool one.

Similar Threads

  1. Forgot password (e.g. secret question) using Acegi
    By lowerymb77 in forum Security
    Replies: 1
    Last Post: Oct 16th, 2005, 10:46 PM
  2. design question: passing context
    By Alarmnummer in forum Management
    Replies: 0
    Last Post: Oct 3rd, 2005, 01:20 PM
  3. Replies: 3
    Last Post: Apr 3rd, 2005, 04:34 PM
  4. Replies: 6
    Last Post: Oct 8th, 2004, 02:21 PM
  5. Question regarding code in UI classes
    By dortman in forum Swing
    Replies: 5
    Last Post: Sep 22nd, 2004, 07:04 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
  •