1 Reply Latest reply on Nov 28, 2011 9:50 AM by Mark Paluch

    error with filter mapping in web.xml

    Dave Chen Master

      Two filter mappings in web.xml

       

         <filter-mapping> 

              <filter-name>filter1</filter-name>

              <url-pattern>/</url-pattern>

              <url-pattern>/w/*</url-pattern>

          </filter-mapping>

         

         <filter-mapping>

              <filter-name>filter2</filter-name>

              <url-pattern>*.do</url-pattern>

          </filter-mapping>

       

       

      for request url: http://www.mydomain.com

       

      filter1 is not invoked, but filter2 is invoked.

      I like filter1 to be invoked, not filter2 for showing homePage http://www.mydomain.com.

       

      I am using JBoss 5.1.0.

       

      Thanks for help.

      Dave

        • 1. Re: error with filter mapping in web.xml
          Mark Paluch Master

          Hi Dave,

          pls. specify only one url-pattern per filter-mapping.

           

          <filter-mapping>

               <filter-name>filter1</filter-name>

               <url-pattern>/w/*</url-pattern>

          </filter-mapping>

           

           

          <filter-mapping>

                <filter-name>filter1</filter-name>

                <url-pattern>/</url-pattern>

            </filter-mapping>

           

          etc.

           

          Best regards,

          Mark