Results 1 to 3 of 3

Thread: Filter chain invoked for both initial request URL and view?

  1. #1

    Question Filter chain invoked for both initial request URL and view?

    Hi.

    I have a question about Spring Security and the invocation of the filter chain. What I can see in the logs is that when a request for say "/" comes in, the filter chain is invoked and does its work. This is what I expect to happen. Then the controller is invoked and the controller returns a specific view (say "/WEB-INF/jsp/index.jsp"). What then happens is something I would not expect as the filter chain is invoked again against "/WEB-INF/jsp/index.jsp".

    Is that normal behavior?

    Many thanks for any clarification on this topic.

    BR,
    Nes

  2. #2
    Join Date
    Jan 2008
    Posts
    1,826

    Default

    What does the web.xml look like? If the springSecurityFilterChain is setup to process FORWARDS it will process the jsp as well. Specifically make sure you have this:

    Code:
      <filter-mapping>
        <filter-name>springSecurityFilterChain</filter-name>
        <url-pattern>/*</url-pattern>
      </filter-mapping>
    and not this:

    Code:
      <filter-mapping>
        <filter-name>springSecurityFilterChain</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
      </filter-mapping>
    Rob Winch - @rob_winch
    Spring Security Lead
    Pivotal

  3. #3

    Default

    Thanks! That worked and solved a heap of other problems too (jsp includes not working ao). Not sure how or when those tags sneaked in. I was in the middle of refactoring offloading static content to the web server. Anyway, thanks for your help. Very much appreciated as I can continue now

Posting Permissions

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