Spring Framework
  1. Spring Framework
  2. SPR-6803

Improve documentation on component-scan using a ContextLoaderListener and DispatcherServlet

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Waiting for Triage
    • Component/s: [Documentation]
    • Labels:
      None

      Description

      Since the introduction of <context:component-scan /> I answer more and more question on issues regarding transactions and proxying in general. Mostly due to the fact that tx:annotation-driven is configured in the root ApplicationContext and that context:component-scan is defined in both the root as well as the servlet ApplicationContext. This results in 2 instances of a @Service/@Repository being available.

      A hint/example in the web chapter of the reference guide would help here on how to configure the context:component-scan in such a case.
      1. only scan @Controller in the servlet and everything but @Controller in the root.
      2. Configure mvc to look for @Controller in the root context, leaving the servlet context almost clean.

      either way should work, although I guess that option 1 is the preffered way.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Marten Deinum
            Last updater:
            Chris Beams
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Days since last comment:
              4 years, 10 weeks, 5 days ago