Announcement Announcement Module
Collapse
No announcement yet.
Filter chain invoked for both initial request URL and view? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

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

    Comment


    • #3
      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

      Comment

      Working...
      X