Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6711045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:05:35+00:00 2026-05-26T08:05:35+00:00

Problem: i want to do filter for all webapps. I created a filter for

  • 0

Problem: i want to do filter for all webapps.

I created a filter for monitoring requests to the apache tomcat server.

for the sake of example, it’s called MyFilter. i created it in netbeans, which created 2 separated 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 when i execute it from netbeans, it deploys it and sends me to http://localhost:8080/MyFilter

whenever i view a page under /MyFilter/somepath – it runs the filter.

i want the filter to run on all paths, and not only for the webapp

Where do i need to locate the project files? which project files do i need? should i edit conf/web.xml and add the filter? or should i only be in the specific webapp’s web.xml?

EDIT:

i copied the generated .war file into tomcat/webapps

when i start tomcat, it creates a directory (tomcat/webapps/MyFilter/)

i added the filter into tomcat/conf/web.xml. when i start it, it fails to load ://localhost:8080/ but successfully loads (and filters) ://localhost:8080/MyFilter

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:05:35+00:00Added an answer on May 26, 2026 at 8:05 am

    A filter will by definition only ever run within the web application it is defined in.

    You could define it in the web.xml in the conf/ directory of Tomcat to have it included in all web applications deployed to that Tomcat by default (note that you’d also need to make the filter class available to all web applications, probably by putting it in the lib/ directory of Tomcat).

    Alternatively, you can implement a Tomcat Valve, which is conceptually similar to a filter, but can be installed on an Engine, Host or Context in Tomcat.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The problem I am trying to solve is that I want to check all
I want to filter out all values of var3 < 5 while keeping at
Problem: I want to list n number of games from each genre (order not
Problem: I want my unicode characters to be stored on disk as (rather tan
The problem: We want to bind a HierarchicalDataTemplate’s ItemsSource property to a CollectionViewSource, to
Core problem: I want to be able to take an instance of a templated
Following problem: I want to render a news stream of short messages based on
The Problem I want to press a key when I have a line highlighted
Really simple problem: I want to split a connection string into its keyword /
SHORT DESCRIPTION OF PROBLEM: I want to set the text of a searchbar without

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.