Problem: I want to make a filter for all webapps.
I created a filter to monitor requests to the Tomcat Apache server.
for example, it is called MyFilter. I created it in netbeans, which created 2 shared directories:
webpages - contains: META-INF WEB-INF index.jsp (a file which i created for viewing monitored data) source packages my.package/MyFilter
in the same case, when I execute it from netbeans, it expands it and sends to http: // localhost: 8080 / MyFilter
whenever I look at a page under / MyFilter / somepath - it starts a filter.
I want the filter to work on all paths, not just webapp
Where do I need to find project files? What project files do I need? should i edit conf / web.xml and add a filter? or should I only be in a specific webapp web.xml?
EDIT:
i copied the generated .war file to tomcat / webapps
when i start tomcat it creates a directory (tomcat / webapps / MyFilter /)
I added a filter to tomcat / conf / web.xml. when I run it, it cannot load: // localhost: 8080 /, but successfully loads (and filters): // localhost: 8080 / MyFilter
source share