Announcement Announcement Module
Collapse
No announcement yet.
Question about FilterInvocationDefinitionSourceEditor Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment


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

      Thanks,
      Patrick

      Comment


      • #4
        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.

        Comment


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

          Comment

          Working...
          X