Can we use regular expressions in web.xml URL patterns?

前端 未结 6 2041
我在风中等你
我在风中等你 2020-11-27 05:02

I am writing a filter to do a specific task but I am unable to set a specific url pattern to my filter. My filter mapping is as follows:



        
6条回答
  •  遥遥无期
    2020-11-27 05:24

    That won't work, no regex can be used there. Try using this urls for your application:

    http://localhost:8080/myapp/org/test/keys/SuperAdminReport/superAdminReport.jsp
    http://localhost:8080/myapp/org/test/keys/Adminreport/adminReport.jsp
    http://localhost:8080/myapp/org/test/keys/OtherReport/otherReport.jsp
    

    And this config for your web.xml:

    
        myFilter
        /org/test/keys/*
    
    

提交回复
热议问题