Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: No WebContext for Security filter

  1. #11
    Join Date
    Jan 2010
    Posts
    7

    Default

    I've run into the same problem described above. Shouldn't the DispatchServlet register the WebApplicationContext.ROOT attribute with the ServletContext? It seems like a bug to me that DispatchServlet doesn't register this attribute especially if Spring Security DelegatingFilterProxy requires it.

  2. #12
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    No it shouldn't... The ROOT context (as also explained by the reference guide) is loaded by the ContextLoaderListener and NOT the DispatcherServlet. Imagine you have multiple DispatcherServlets, which servlet is the root context (trust me this isn't far fetched it is actually a situation I worked with next to some MessageDispatcherServlets).
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #13
    Join Date
    Jan 2010
    Posts
    7

    Default

    Thanks. I followed the steps you laid out for Aahzmandius and it worked. It was my mistake using DispatchServlet to load the full application. Correcting this also solved some other issues we had with multiple application contexts...

    For other readers, steps followed:
    1. Move application beans and config to service-context.xml
    2. Setup ContextLoaderListener, in web.xml, with service-context.xml (the WebApplicationContext.ROOT)
    3. Left Spring Web MVC config, including view config, in servlet-config.xml
    4. Setup DispatchServlet, in web.xml, with servlet-config.xml

Tags for this Thread

Posting Permissions

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