All Packages Class Hierarchy This Package Previous Next Index
Class sun.servlet.http.HttpServerHandler
java.lang.Object
|
+----sun.servlet.http.HttpServerHandler
- public class HttpServerHandler
- extends Object
- implements Runnable, ServletConnection
This class represents a connection handler in the servlet server.
-
buf
- Temporary buffer for file requests.
-
PREFIX
- The URL prefix for invoking servlets.
-
PREFIX_LEN
- The servlet URL prefix length.
-
req
- The servlet request.
-
res
- The servlet response.
-
server
- The server for this handler.
-
socket
- The current socket connection.
-
HttpServerHandler(HttpServer)
- Creates a new handler for the specified server.
-
getInputStream()
- Returns the input stream for reading from the connection.
-
getOutputStream()
- Returns the output stream for writing to the connection.
-
getRealPath(String)
- Returns the translated path for the specified virtual path.
-
getRemoteAddr()
- Returns the remote address of the socket connection.
-
getRemoteHost()
- Returns the local port of the socket connection.
-
getServerName()
- Returns the host name of the server.
-
getServerPort()
- Returns the post number of the server.
-
handleConnection(Socket)
- Handles a single connection from the client.
-
parsePath(MessageBytes, HttpRequest)
- Parses a servlet path.
-
run()
- Runs the connection handler.
-
sendResponse(HttpRequest, HttpResponse)
- Sends a response to the client.
server
protected HttpServer server
- The server for this handler.
req
protected final HttpRequest req
- The servlet request.
res
protected final HttpResponse res
- The servlet response.
socket
protected Socket socket
- The current socket connection.
buf
protected byte buf[]
- Temporary buffer for file requests.
PREFIX
protected static String PREFIX
- The URL prefix for invoking servlets.
PREFIX_LEN
protected static int PREFIX_LEN
- The servlet URL prefix length.
HttpServerHandler
protected HttpServerHandler(HttpServer server)
- Creates a new handler for the specified server.
run
public void run()
- Runs the connection handler.
handleConnection
protected void handleConnection(Socket s) throws IOException
- Handles a single connection from the client.
- Parameters:
- s - the connection socket
sendResponse
protected void sendResponse(HttpRequest req,
HttpResponse res) throws ServletException, IOException
- Sends a response to the client.
- Throws: ServletException
- if thrown by the servlet
parsePath
protected String parsePath(MessageBytes path,
HttpRequest req)
- Parses a servlet path. Returns the name of the servlet or null if
the path was invalid.
getServerName
public String getServerName()
- Returns the host name of the server.
getServerPort
public int getServerPort()
- Returns the post number of the server.
getRemoteHost
public String getRemoteHost()
- Returns the local port of the socket connection.
getRemoteAddr
public String getRemoteAddr()
- Returns the remote address of the socket connection.
getRealPath
public String getRealPath(String path)
- Returns the translated path for the specified virtual path.
getInputStream
public InputStream getInputStream() throws IOException
- Returns the input stream for reading from the connection.
getOutputStream
public OutputStream getOutputStream() throws IOException
- Returns the output stream for writing to the connection.
All Packages Class Hierarchy This Package Previous Next Index