This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Blocking access to a file extension Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Products » Tomcat
Bookmark "Blocking access to a file extension" Watch "Blocking access to a file extension" New topic

Blocking access to a file extension

Fernando Vissentini

Joined: Oct 06, 2003
Posts: 11
Hi, is there anyway to block the access to a file that has a specific extension in the tomcat configuration? for instance: I wanna block files with extensions EXE to be accessed.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63196

Then why have them under your web app root in the first place?

You might get better responses if you informed us what the exe files are used for.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 12999
I suppose you could map the extension to a servlet that said "not allowed"
Look at the way *.jsp is mapped to the JspServlet in the default web.xml for an example.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Blocking access to a file extension
It's not a secret anymore!