Hi,
I could not find a good answer on the following, so I hope there
is someone to help me.
Problem:
I have a large filesystem based on CDs. For each file the webserver
is going to retrieve, a process should check out if the file is
directly available or not. If the image/page/... is not available,
the process will send a message page or replacement image instead.
I started out solving this by using servlets and JavaWebServer. There
are (as far as I know) three possible ways to implement this behavior:
1. Act as a independent file servlet
This means replacing com.sun.server.webserver.FileServlet. A
major drawback is that a lot of extra handling of files needs
to be implemented. What should be handled? What happens if a
newer version of the server is released?
2. Derive from sun's FileServlet
This is an option, but it makes it very server specific. Problem
here is I still need to cope with the '/' to '/index.html'
trans-
lation (or other welcome pages). If I pass the request to the
super class, I loose control over the loading of the page, since
the server does serve the page directly rather than sending a
redirection to the client.
3. Redirect to sun's FileServlet
This should be a better option than 2, since the classname can
be made configurable for a user. Translation is still an issue
and I was not able to make it work using the RequestDispatcher.
Questions:
1. What is the argument to getRequestDispatcher() to retrieve the
FileServlet ("com.sun.server.webserver.FileServlet" didn't work)
or isn't it possible?
2. Is there a (preferably server-independent) way to get the trans-
lated URL for welcome/index pages?
3. Is it advisable to go for the independent servlet implementation?
4. If yes, what are all the issues to think about?
Any suggestions and/or answers are greatly appreciated.
Michael
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html