Femto Web Server V1.4-F

Package dfischer.femtowebserver.httpd

Contains the Femto Web Server main thread and all classes for Weblets, "Simple Server Side Includes" (SSSI), HTTP filters (including HTTP sessions and cookies) and network protocol adapters.

See:
          Description

Interface Summary
HttpdConnectionAdapterInterface Connection Adapters - network protocol listeners - are used to wire the Femto Web Server to a specific network protocol.
HttpdSssiInterface SSSI - Simple Server Side Includes. SSSI are directives that are placed in static HTML pages, and evaluated on the server while the HTML pages are being served.
HttpdWebletInterface Weblets - direct from web browser executable java classes. Weblets are special java classes, which can be called direct from the browser - similar to Java Servlets or CGI scripts.
 

Class Summary
HttpCookie Contains the data of one single, received cookie from the agent (browser).
Httpd This is the Femto Web Server main class which is implemented as an independent thread.
HttpdConnection Represents a network protocol independent client connection to the Femto Web Server.
HttpdFilter A HttpdFilter is an object that allows filtering tasks on either the HTTP request to a resource (a Weblet or static content), or on the HTTP response from a resource, or both.
HttpdProperties Allows Weblets, SSSIs, filters and connection adapters to access the configuration of the Femto Web Server (read/only access).
HttpdSession HTTP sessions can be used to overlay the stateless HTTP protocol with stateful information, valid over the whole surfing session of an user.
HttpdSessionHashtable Contains and manages all HTTP sessions of one Femto Web Server instance.
HttpRequest Allows Weblets and SSSIs to access the HTTP request data (browser request) and (optionally) allows a Filter to modify every HTTP request.
HttpResponse Sets the Weblet HTTP response data (server response) and (optionally) allows a Filter to modify every HTTP response.
HttpUploadFile Data encapsulation for uploaded files.
 

Package dfischer.femtowebserver.httpd Description

Contains the Femto Web Server main thread and all classes for Weblets, "Simple Server Side Includes" (SSSI), HTTP filters (including HTTP sessions and cookies) and network protocol adapters.

Programming Example of the Femto Web Server Main Thread

import dfischer.femtowebserver.httpd.Httpd;
import java.net.*;

public class FemtoWebServerDemo
{		  
	public static void main(String args[])
	{
		try
		{
			// create new instance of the Femto Web Server
			Httpd httpdThread = new Httpd();

			// configure the web server
			String serverName = "127.0.0.1";
			try { serverName = InetAddress.getLocalHost().getHostName(); } catch (Exception ex) {}
			httpdThread.setServerName(serverName);
			httpdThread.setServerPort(83);
			httpdThread.setWelcomePage("/dfischer/femtowebserver/test/Welcome.html");
			httpdThread.setRestrictedMimeMapping();
			httpdThread.setTimeZone("ECT");
			
			// add HTTP sessions
			httpdThread.addFilter("dfischer.femtowebserver.filter.HttpSessionCookieHandler");
			
			// start the web server
			httpdThread.start();
			httpdThread.join();		// wait here forever
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
}
This example is already pre-compiled inside the package femtowebserver.jar
  1. Add the package femtowebserver.jar to the CLASSPATH
  2. Start the Femto Web Server with "java FemtoWebServerDemo"
  3. Start your web browser, enter http://127.0.0.1:83 as URL - and try it!


Femto Web Server V1.4-F

Copyright 2002, 2003, 2006 by Ingenieurbüro David Fischer GmbH, Switzerland. All rights reserved.