Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
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

Win a copy of The Software Craftsman this week in the Agile forum!
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: 62298

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: 12913
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.
Have you tried LearnNowOnline?
subject: Blocking access to a file extension