EAF 7.6 Implementation

org.enhydra.servlet.servlets
Class FileServerServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.enhydra.servlet.servlets.FileServerServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class FileServerServlet
extends javax.servlet.http.HttpServlet

This class serves files from HTTP request. Currently only a limited Http GET request will be processed. CGI arguments will not be processed. The initial parameter 'index=something.html' can for the default html page. If this parameter is not set then it will default to "index.html".

Version:
1.8, 3/98
See Also:
Serialized Form

Constructor Summary
FileServerServlet()
          Create a new FileServerServlet.
 
Method Summary
 void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          This method will process a limited http GET request for a file.
 void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Http POST command is currently not supported and indicates this sending a message to the client.
 java.lang.String getServletInfo()
          Returns a string containing servlet infoemation including name, and docRoot.
 void init(javax.servlet.ServletConfig config)
          This initializes the servlet and sets the variables docRoot and log logging options.
 java.lang.String toHtml()
          Extra status info, shown by the Enhydra Server admin status page.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileServerServlet

public FileServerServlet()
Create a new FileServerServlet.

Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
This initializes the servlet and sets the variables docRoot and log logging options.

Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Parameters:
config - The servlet configuration object.
Throws:
If - an exception occured during initialztion
javax.servlet.ServletException

doGet

public void doGet(javax.servlet.http.HttpServletRequest req,
                  javax.servlet.http.HttpServletResponse res)
           throws javax.servlet.ServletException,
                  java.io.IOException
This method will process a limited http GET request for a file. The method will serve files, but will not process cgi arguments.

Overrides:
doGet in class javax.servlet.http.HttpServlet
Parameters:
req - encapsulates the request to the servlet.
res - encapsulates the response from the servlet.
Throws:
if - the request could not be handled.
if - detected when processing.
javax.servlet.ServletException
java.io.IOException

doPost

public void doPost(javax.servlet.http.HttpServletRequest req,
                   javax.servlet.http.HttpServletResponse res)
            throws javax.servlet.ServletException,
                   java.io.IOException
Http POST command is currently not supported and indicates this sending a message to the client.

Overrides:
doPost in class javax.servlet.http.HttpServlet
Parameters:
req - encapsulates the request to the servlet.
res - encapsulates the response from the servlet.
Throws:
if - the request could not be handled.
if - detected when processing.
javax.servlet.ServletException
java.io.IOException

getServletInfo

public java.lang.String getServletInfo()
Returns a string containing servlet infoemation including name, and docRoot.

Specified by:
getServletInfo in interface javax.servlet.Servlet
Overrides:
getServletInfo in class javax.servlet.GenericServlet
Returns:
Servlet informatioon.

toHtml

public java.lang.String toHtml()
Extra status info, shown by the Enhydra Server admin status page.


EAF 7.6 Implementation