First and most important question for me would be: What do you need this
for? As Kevin points out, let Jetty serve the static files.

If this is a debugging aid for the sample container, the code should not
be in the gadgets module. It belongs in the samples or server module
(maybe server will sprout its own java code base for pure sample
purposes).

This thing as a tremendous potential to be abused, if it goes in, I
expect a lot of patch suggestions to remove the localhost test. And it
breaks if I try to access a file using my regular host name (which I do
all the time), because it resolves to my network Ip and not localhost.

Summary: Don't put this in. There are better ways to do it. If you
insist to put it in, please don't put it into the gadgets codebase, put
it into the server or samples and clearly mark it as "DEBUG CODE. DO NOT
RUN IN PRODUCTION" (e.g. log this on startup.


http://codereview.appspot.com/10269

Reply via email to