This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Filter mapping for static files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Filter mapping for static files" Watch "Filter mapping for static files" New topic
Author

Filter mapping for static files

Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10170
    
    8

I have a Tomcat hosted app. I wish to log the IPs of the clients.
I have a static index.html file which I have defined in my web.xml <welcome-file-list>

Now I wrote a simple tracker filter with the following doFilter

and modified my web.xml to


I tried changing the url-pattern to /html /.html and /*html. I do not see the logged information.
What am I doing wrong?


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10170
    
    8

Update: Though I am using Tomcat for dev, it is a Google App Engine project. GAE caches and serves static resources to enhance efficiency. I modified the appengine-web.xml to exclude the html file and I can see the IP in the log.
So essentially the url-pattern /* or even/Test.html is correct.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Filter mapping for static files
 
Similar Threads
Filters....not working for me :(
Servlet Filtering doesnt work on iPlanet 6
Filters - not working for me..
Problem invoking filter
request does not pass to action