Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-17048

[GSS](7.2.z) UNDERTOW-1556 - filter not invoked for matching /* path

XMLWordPrintable

    • +
    • Hide

      Configure the servlet path mapping to the same path as the filter:

          <servlet-mapping>
              <servlet-name>MyServlet</servlet-name>
              <url-pattern>/MyServlet/*</url-pattern>
          </servlet-mapping>
          
          <filter-mapping>
              <filter-name>MyFilter</filter-name>
              <url-pattern>/MyServlet/*</url-pattern>
          </filter-mapping>
      

      Or configure the filter mapping to map the filter to the servlet with "<servlet-name>":

          <filter-mapping>
              <filter-name>MyFilter</filter-name>
              <url-pattern>/MyServlet/*</url-pattern>
              <servlet-name>MyServlet</servlet-name>
          </filter-mapping>
      

      Or configure the filter mapping to add a new "<url-pattern>" for the /MyServlet path:

          <filter-mapping>
              <filter-name>MyFilter</filter-name>
              <url-pattern>/MyServlet</url-pattern>
              <url-pattern>/MyServlet/*</url-pattern>
          </filter-mapping>
      
      Show
      Configure the servlet path mapping to the same path as the filter: <servlet-mapping> <servlet-name>MyServlet</servlet-name> <url-pattern>/MyServlet/*</url-pattern> </servlet-mapping> <filter-mapping> <filter-name>MyFilter</filter-name> <url-pattern>/MyServlet/*</url-pattern> </filter-mapping> Or configure the filter mapping to map the filter to the servlet with "<servlet-name>": <filter-mapping> <filter-name>MyFilter</filter-name> <url-pattern>/MyServlet/*</url-pattern> <servlet-name>MyServlet</servlet-name> </filter-mapping> Or configure the filter mapping to add a new "<url-pattern>" for the /MyServlet path: <filter-mapping> <filter-name>MyFilter</filter-name> <url-pattern>/MyServlet</url-pattern> <url-pattern>/MyServlet/*</url-pattern> </filter-mapping>

      With mappings like below, the filter is not invoked for a MyServlet request:

          <servlet-mapping>
              <servlet-name>MyServlet</servlet-name>
              <url-pattern>/MyServlet</url-pattern>
          </servlet-mapping>
      
          <filter-mapping>
              <filter-name>MyFilter</filter-name>
              <url-pattern>/MyServlet/*</url-pattern>
          </filter-mapping>
      

      This worked with EAP 6 and is avoided on EAP 7 if the servlet is mapped the the same /* path

          <servlet-mapping>
              <servlet-name>MyServlet</servlet-name>
              <url-pattern>/MyServlet/*</url-pattern>
          </servlet-mapping>
      
          <filter-mapping>
              <filter-name>MyFilter</filter-name>
              <url-pattern>/MyServlet/*</url-pattern>
          </filter-mapping>
      

              flaviarnn Flavia Rainone
              rhn-support-aogburn Aaron Ogburn
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: