Announcement Announcement Module
No announcement yet.
J2EE filter and Spring MVC controllers, can they be used together? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • J2EE filter and Spring MVC controllers, can they be used together?

    Requests sent to my Spring MVC system are being processed by a J2EE filter but never making it to the Spring controllers. Can these two components be used together or do I need to use DelegatingProxyFilter to allow filtered requests to make it to the controllers. Or is this just a symptom of a URL mapping problem?

    From my web.xml:
        <!-- filter that adds the command and, optionally, the subcommand as an attribute of the servlet request -->
                Adds command[subcommand] as an attribute of the request object
        <!-- the command filter needs to see every incoming request -->

    Thanks for any help or advice,

  • #2
    It's me answering my own question here. The short answer is yes. (obviously) J2EE filters and Spring MVC play nice together, no problem using them both in an application. DelegatingProxyFilter is useful of you need a filter that has access to the spring IOC.

    In case you are interested, my problem turned out to be an incorrect <context:component-scan base-package=...> when the package name of the controllers was changed.

    Hope this helps future J2EE + Spring MVC users.